var CON_VERSION = {
    release: '2016.04.28_043600',
    dir: 'nt6.1.10.1',
    script: '2016.04.28',
    ntid: '2016.04.28',
    im: '2016.04.28',
    chat: '2016.04.28',
    publish: '2016.03.25_000000'
};
var CON_RULE = {};
var CON_SERVER = {
    flashserver: 'http://nt-downt.17ugo.cn/t2d/'
};

/* @file nt1.js
 * @date 2016.04.28 03:23:01 
 */
(function(j) {
    var J, z = [],
    y = {},
    u = j.location,
    h = j.document,
    r = j.navigator,
    s = [],
    K = s.slice,
    P = {}.hasOwnProperty,
    Q = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
    R = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
    S = /[\-\+0-9\.]/ig,
    T = /-([a-z])/ig,
    U = /(<.*?>)/ig,
    c = function(a, b) {
        return new c.fn.init(a, b, J)
    },
    A = !1;
    c.fn = c.prototype = {
        talkVersion: "2015.09.23",
        constructor: c,
        init: function(a, b, d) {
            var e;
            if (!a) return this;
            if ("string" === typeof a) {
                if ((e = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && 3 <= a.length ? [null, a, null] : Q.exec(a)) && (e[1] || !b)) {
                    if (e[1]) b = b instanceof c ? b[0] : b,
                    c.merge(this, c.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b: h, !0));
                    else {
                        if ((b = h.getElementById(e[2])) && b.parentNode) this.length = 1,
                        this[0] = b;
                        this.context = h;
                        this.selector = a
                    }
                    return this
                }
                return ! b || b.talkVersion ? (b || d).find(a) : this.constructor(b).find(a)
            }
            if (a.nodeType || c.isWindow(a)) return this.context = this[0] = a,
            this.length = 1,
            this;
            if (c.isObject(a) && a.talkVersion) return a.length && (this.context = this[0] = a[0], this.length = 1),
            this;
            if (c.isPlainObject(a)) return b = a.tag || "div",
            delete a.tag,
            this.context = this[0] = c.Element(b, a),
            this.length = 1,
            this;
            if (c.isFunction(a)) return c.ready(a);
            void 0 !== a.selector && (this.selector = a.selector, this.context = a.context);
            return c.merge(this, [a])
        },
        selector: "",
        length: 0,
        toArray: function() {
            return K.call(this)
        },
        get: function(a) {
            return null === a ? this.toArray() : 0 > a ? this[this.length + a] : this[a]
        },
        pushStack: function(a) {
            a = c.merge(this.constructor(), a);
            a.prevObject = this;
            a.context = this.context;
            return a
        },
        slice: function() {
            return this.pushStack(K.apply(this, arguments))
        },
        eq: function(a) {
            var b = this.length,
            a = +a + (0 > a ? b: 0);
            return this.pushStack(0 <= a && a < b ? [this[a]] : [])
        },
        first: function() {
            return this.eq(0)
        },
        last: function() {
            return this.eq(this.length - 1)
        },
        each: function(a, b) {
            return c.each(this, a, b)
        },
        find: function(a) {
            a = this.constructor.selector.query(a, this);
            return this.pushStack(a)
        },
        push: s.push,
        sort: [].sort,
        splice: [].splice
    };
    c.fn.init.prototype = c.fn;
    c.extend = c.fn.extend = function() {
        var a, b, d, e, f = arguments[0] || {},
        g = 1,
        i = arguments.length,
        k = !1;
        "boolean" === typeof f && (k = f, f = arguments[1] || {},
        g = 2);
        "object" !== typeof f && !c.isFunction(f) && (f = {});
        i === g && (f = this, --g);
        for (; g < i; g++) if (a = arguments[g]) for (var m in a) a.hasOwnProperty(m) && (b = f[m], d = a[m], f !== d && (k && d && (c.isPlainObject(d) || (e = c.isArray(d))) ? (e ? (e = !1, b = b && c.isArray(b) ? b: []) : b = b && c.isPlainObject(b) ? b: {},
        f[m] = c.extend(k, b, d)) : void 0 !== d && (f[m] = d)));
        return f
    };
    c.extend({
        CON_CACHE_COOKIE: "nTalk_CACHE_DATA",
        CON_MANAGE_COOKIE: "nTalk_PAGE_MANAGE",
        CON_PCID_KEY: "NTKF_T2D_CLIENTID",
        CON_CONNECT_FLASH: "FLASH",
        CON_CONNECT_COMET: "COMET",
        STYLE_BODY: "margin:0;padding:0;border:none;float:none;width:auto;height:auto;min-width:none;min-height:none;max-width:none;max-height:none;clear:none;position:static;left:auto;top:auto;right:auto;bottom:auto;text-align:left;box-sizing:content-box;color:#000;background-color:transparent;font:normal normal normal 12px/160% Arial,Microsoft YaHei;",
        STYLE_NBODY: "margin:0;padding:0;border:none;float:none;width:auto;height:auto;min-width:none;min-height:none;max-width:none;max-height:none;clear:none;position:static;left:auto;top:auto;right:auto;bottom:auto;text-align:left;box-sizing:content-box;color:#000;background-color:transparent;font:normal normal normal 0px/0px Arial,Microsoft YaHei;",
        isReady: !1,
        Log: new Function,
        charset: h.charset || h.characterSet,
        language: r.language || r.systemLanguage,
        protocol: u.protocol,
        url: u.href,
        title: h.title,
        referrer: h.referrer,
        source: "",
        domain: "",
        baseProtocol: "",
        baseURI: "",
        sourceURI: "",
        baseName: "",
        baseExt: "",
        extParmas: {},
        pageURI: "",
        pageName: "",
        params: null,
        hashParams: null,
        user: {},
        lang: null,
        server: null,
        global: {},
        IMPRESENCE: null,
        version: {
            pub: "2015.09.23"
        },
        elementParent: null,
        elementBefore: null,
        themesURI: "",
        isNumeric: function(a) {
            return ! isNaN(parseFloat(a)) && isFinite(a)
        },
        isBoolean: function(a) {
            return "boolean" === typeof a
        },
        isDefined: function(a) {
            return "undefined" !== typeof a
        },
        isWindow: function(a) {
            return a && a == a.window
        },
        isFunction: function(a) {
            return "[object Function]" === Object.prototype.toString.call(a)
        },
        isArray: function(a) {
            return c.isFunction(Array.isArray) ? Array.isArray(a) : "[object Array]" === Object.prototype.toString.call(a)
        },
        isObject: function(a) {
            return "[object Object]" === Object.prototype.toString.call(a) && a && !this.isDefined(a.nodeType)
        },
        isEmptyObject: function(a) {
            for (var b in a) if (a.hasOwnProperty(b)) return ! 1;
            return ! 0
        },
        isPlainObject: function(a) {
            if ("object" !== typeof a || a.nodeType || this.isWindow(a)) return ! 1;
            try {
                if (a.constructor && !P.call(a.constructor.prototype, "isPrototypeOf")) return ! 1
            } catch(b) {
                return ! 1
            }
            return ! 0
        },
        getWindow: function(a) {
            return c.isWindow(a) ? a: 9 === a.nodeType && a.defaultView
        },
        bind: function(a, b) {
            var d = Array.prototype.slice.call(arguments).slice(2);
            return function(e) {
                return b.apply(a, [e || j.event].concat(d))
            }
        },
        parseHTML: function(a, b) {
            if (!a || "string" !== typeof a) return null;
            var b = b || h,
            d = R.exec(a);
            return d ? [b.createElement(d[1])] : /<|&#?\w+;/.test(a) ? (d = b.createElement("div"), d.innerHTML = a, c.merge([], d.childNodes)) : [b.createTextNode(a)]
        },
        merge: function() {
            var a = arguments[0] || {},
            b = arguments,
            d,
            e,
            c;
            if (1 >= b.length) return a;
            for (d = 1; d < b.length; d++) if (b[d] && null !== b[d]) if (void 0 === b[d].length) for (e in b[d]) b[d].hasOwnProperty(e) && (a[e] = b[d][e]);
            else {
                e = 0;
                for (c = b[d].length; e < c; e++) void 0 !== a.length ? a.push(b[d][e]) : a[e] = b[d][e]
            }
            return a
        },
        each: function(a, b, d) {
            c.isArray(d) || (d = []);
            if (c.isArray(a) || c.isObject(a) && a.talkVersion) for (var e = 0; e < a.length && !1 !== b.apply(a[e], [e, a[e++]].concat(d)););
            else if (c.isObject(a)) for (e in a) a.hasOwnProperty(e) && b.apply(a[e], [e, a[e]].concat(d));
            else b.apply(a, [0, a].concat(d));
            return a
        },
        access: function(a, b, d, e, f) {
            var g = 0,
            i = a.length;
            if (c.isPlainObject(d)) {
                var f = !0,
                k;
                for (k in d) d.hasOwnProperty(k) && c.access(a, b, k, d[k], !0)
            } else if (void 0 !== e) for (f = !0; g < i; g++) b(a[g], d, e);
            return f ? a: i ? b(a[0], d) : null
        },
        strFormat: function(a, b) {
            for (var d = "",
            e = 1,
            c = b || 2; e <= c; e++) d += "0";
            d += a || "";
            return d.substr(d.length - c)
        },
        getTime: function(a) {
            var b = (new Date).getTime(),
            d = 1E3 * Math.random(),
            d = this.strFormat(Math.floor(d), 3);
            switch (a) {
            case 2:
                return b.toString() + d;
            case 1:
                return b + d;
            default:
                return b
            }
        },
        secondsToMinutes: function(a) {
            var b = "",
            d = this.strFormat;
            60 <= a ? (b += d(Math.floor(a / 60)), a %= 60) : b += "00";
            return b + ":" + d(a)
        },
        formatDate: function(a, b) {
            var d, e;
            this.isNumeric(a) ? d = new Date(a) : "string" == typeof a ? (d = new Date, b = a) : d = new Date;
            b = b || "HH:mm:ss";
            e = {
                "M+": d.getMonth() + 1,
                "d+": d.getDate(),
                "h+": 0 == d.getHours() % 12 ? 12 : d.getHours() % 12,
                "H+": d.getHours(),
                "m+": d.getMinutes(),
                "s+": d.getSeconds(),
                "q+": Math.floor((d.getMonth() + 3) / 3),
                "S+": d.getMilliseconds()
            };
            /(y+)/i.test(b) && (b = b.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length)));
            for (var c in e) e.hasOwnProperty(c) && RegExp("(" + c + ")").test(b) && (b = "S" == RegExp.$1 ? b.replace(RegExp.$1, ("00" + e[c]).substr(3)) : b.replace(RegExp.$1, 1 == RegExp.$1.length ? e[c] : ("00" + e[c]).substr(("" + e[c]).length)));
            return b
        },
        randomChar: function(a, b) {
            for (var d = "",
            e = a || 8,
            c = 10 == b ? "0123456789": "0123456789ABCDEF", g = 0; g < e; g++) d += c.charAt(Math.round(Math.random() * (c.length - 1)));
            return d
        }
    });
    c.selector = {
        tagGuid: 1,
        attrMap: {
            "class": "className",
            "for": "htmlFor"
        },
        rex: {
            R_RULE: /[ +>~]/g,
            NR_RULE: /[^ +>~]+/g,
            TRIM_LR: /^ +| +$/g,
            TRIM_ALL: / *([ +>~,]) */g,
            PSEU_PARAM: /\([^()]+\)/g,
            ATTR_PARAM: /[^\[]+(?=])/g,
            ATTR: /=|!=|\^=|\$=|\*=|~=|\|=/,
            CLS: /\./g,
            PSEU: /[^:]+/g,
            NUM: /\d+/,
            NTH: /(-?\d*)n([+-]?\d*)/,
            RULES: /((?:#.+)*)([a-zA-Z1-6*]*)([^\[:]*)((?:\[.+])*)((?::.+)*)/
        },
        query: function(a, b) {
            if ("undefined" == typeof a || !a) return [];
            var d = [],
            e,
            c,
            g,
            i,
            k,
            m,
            j;
            switch (typeof b) {
            case "undefined":
                c = [h];
                break;
            case "string":
                a = b + " " + a;
                c = [h];
                break;
            case "object":
                c = b.nodeType ? [b] : b
            }
            e = this.format(a);
            b = c;
            i = 0;
            for (k = e.length; i < k; i++) {
                a = e[i];
                g = (" " + a).match(this.rex.R_RULE);
                a = a.match(this.rex.NR_RULE);
                c = b;
                m = 0;
                for (j = g.length; m < j; m++) c = this.parse(a[m], c, g[m]);
                d = d.concat(c)
            }
            return 1 < k ? this.makeDiff(d) : d
        },
        format: function(a) {
            var b = [],
            d = [];
            this.pseuParams = b;
            this.attrParams = d;
            for (a = a.replace(this.rex.TRIM_LR, "").replace(this.rex.TRIM_ALL, "$1").replace(this.rex.ATTR_PARAM,
            function(a) {
                return d.push(a) - 1
            }); - 1 !== a.indexOf("(");) a = a.replace(this.rex.PSEU_PARAM,
            function(a) {
                return b.push(a.substring(1, a.length - 1)) - 1
            });
            return a.split(",")
        },
        parse: function(a, b, d) {
            var e, a = this.rex.RULES.exec(a);
            if (e = a[1]) return (e = h.getElementById(e.substring(1))) ? [e] : [];
            b = c.selector.queryRelative[d](b, a[2] || "*", this);
            if (d = a[3]) b = this.filterClass(b, d.replace(this.rex.CLS, ""));
            if (d = a[4]) b = this.filterAttr(b, this.getAttrRules(d.match(this.rex.ATTR_PARAM), this.attrParams));
            if (a = a[5]) b = this.filterPseudo(b, this.getPseudoRules(a.match(this.rex.PSEU), this.pseuParams));
            return b
        },
        getRules: function(a) {
            var b, a = this.rex.RULES.exec(a);
            a[2] || (a[2] = "*");
            a[3] = a[3].replace(this.rex.CLS, "");
            if (b = a[4]) a[4] = this.getAttrRules(b.match(this.rex.ATTR_PARAM), this.attrParams);
            if (b = a[5]) a[5] = this.getPseudoRules(b.match(this.rex.PSEU), this.pseuParams);
            return a
        },
        getAttrRules: function(a, b) {
            for (var d = [], e = a.length, f = this.rex.ATTR, g = 0, i, k; g < e; g++) i = b[a[g]],
            k = i.match(f) || " ",
            i = i.split(f),
            d.push(c.selector.queryAttrs[k]),
            d.push(i);
            return d
        },
        getPseudoRules: function(a, b) {
            for (var d = [], e = 0, f = a.length, g = this.tagGuid++, i, k, m; e < f; e++) {
                i = a[e];
                if (this.rex.NUM.test(i)) switch (k = b[RegExp["$&"]], i = RegExp["$`"], i) {
                case "nth-child":
                    if (this.rex.NTH.test("odd" === k && "2n+1" || "even" === k && "2n" || k)) {
                        if (k = RegExp.$1, k = "" === k ? 1 : "-" === k ? -1 : k, k = [g, !0, k, RegExp.$2], 1 === k[2] && 0 === k[3]) continue
                    } else k = [g, !1, k];
                    break;
                case "not":
                    m = k.split(",");
                    for (k = []; m.length;) k.push(this.getRules(m.pop()))
                }
                d.push(c.selector.queryPseudos[i]);
                d.push(k)
            }
            return d
        },
        filterPseudo: function(a, b) {
            for (var d = a.length,
            e = 0,
            c = b.length,
            g = [], i, k, m, h; e < d; e++) {
                k = a[e];
                for (i = 0; i < c && !(m = b[i], h = b[i + 1], !m || !m(k, h, this)); i += 2);
                i === c && g.push(k)
            }
            return g
        },
        filterAttr: function(a, b) {
            for (var d = a.length,
            c = 0,
            f = b.length,
            g = [], i, k, m, h, j, l; c < d; c++) {
                k = a[c];
                for (i = 0; i < f; i += 2) {
                    h = b[i];
                    m = b[i + 1];
                    l = m[0];
                    if (! (j = k.getAttribute(l))) if (! (j = k[this.attrMap[l] || l])) break;
                    if (!h(j + "", m[1])) break
                }
                i === f && g.push(k)
            }
            return g
        },
        filterClass: function(a, b) {
            for (var d = 0,
            c = a.length,
            f = [], g, i; d < c; d++) i = a[d],
            "string" == typeof i.className && (g = i.className, g = RegExp(g.replace(" ", "|"), "g"), b.replace(g, "") || f.push(i));
            return f
        },
        filterEl: function(a, b, d, c, f) {
            return "*" !== b && a.nodeName.toLowerCase() !== b || d && !this.filterClass([a], d).length || c && !this.filterAttr([a], c).length ? !1 : !(f && !this.filterPseudo([a], f).length)
        },
        makeDiff: function(a) {
            for (var b = this.tagGuid++,
            d = a.length,
            c = [], f = 0, g, i; f < d; f++) g = a[f],
            i = this.getElData(g),
            i.tagGuid !== b && (c.push(g), i.tagGuid = b);
            return c
        },
        getElData: function(a) {
            var b = a.mojoExpando;
            b || (b = a.mojoExpando = {
                mQuery: {
                    tagGuid: 0
                }
            });
            if (! (b = b.mQuery)) b = {
                tagGuid: 0
            };
            return b
        },
        queryRelative: {
            " ": function(a, b, d) {
                for (var c = d.tagGuid++,
                f = a.length,
                g = [], i = 0, k, m, h; i < f; i++) {
                    k = a[i];
                    if (m = k.parentNode) {
                        if (d.getElData(m).tagGuid === c) continue;
                        d.getElData(k).tagGuid = c
                    }
                    h = k.getElementsByTagName(b) || null;
                    k = 0;
                    for (m = h.length; k < m; k++) g.push(h[k])
                }
                return g
            },
            ">": function(a, b) {
                for (var d = [], c = a.length, f = 0, g; f < c; f++) for (g = a[f].firstChild; g;) 1 === g.nodeType && (g.nodeName.toLowerCase() === b || "*" === b) && d.push(g),
                g = g.nextSibling;
                return d
            },
            "+": function(a, b) {
                for (var d = [], c = a.length, f = 0, g; f < c; f++) for (g = a[f]; g = g.nextSibling;) if (1 === g.nodeType) { (g.nodeName.toLowerCase() === b || "*" === b) && d.push(g);
                    break
                }
                return d
            },
            "~": function(a, b, d) {
                for (var c = d.tagGuid++,
                f = a.length,
                g = [], i = 0, k, h; i < f; i++) {
                    k = a[i];
                    if (h = k.parentNode) {
                        if ((h = d.getElData(h)).tagGuid === c) continue;
                        h.tagGuid = c
                    }
                    for (; k = k.nextSibling;) 1 === k.nodeType && (k.nodeName.toLowerCase() === b || "*" === b) && g.push(k)
                }
                return g
            }
        },
        queryAttrs: {
            " ": function() {
                return ! 0
            },
            "=": function(a, b) {
                return a === b
            },
            "!=": function(a, b) {
                return a !== b
            },
            "^=": function(a, b) {
                return 0 === a.indexOf(b)
            },
            "$=": function(a, b) {
                return a.substring(a.length - b.length) === b
            },
            "*=": function(a, b) {
                return - 1 !== a.indexOf(b)
            },
            "~=": function(a, b) {
                return - 1 !== (" " + a + " ").indexOf(" " + b + " ")
            },
            "|=": function(a, b) {
                return a === b || a.substring(0, b.length + 1) === b + "-"
            }
        },
        queryPseudos: {
            eq: function(a, b, d) {
                var c, f, g;
                if ((c = a.parentNode) && (g = d.getElData(c)).tagGuid !== b) {
                    c = c.firstChild;
                    for (f = 1; c;) 1 === c.nodeType && (d.getElData(c).nodeIndex = f++),
                    c = c.nextSibling;
                    g.tagGuid = b
                }
                return d.getElData(a).nodeIndex == b
            },
            lt: function(a, b, d) {
                var c, f, g;
                if ((c = a.parentNode) && (g = d.getElData(c)).tagGuid !== b) {
                    c = c.firstChild;
                    for (f = 1; c;) 1 === c.nodeType && (d.getElData(c).nodeIndex = f++),
                    c = c.nextSibling;
                    g.tagGuid = b
                }
                return d.getElData(a).nodeIndex < b
            },
            gt: function(a, b, d) {
                var c, f, g;
                if ((c = a.parentNode) && (g = d.getElData(c)).tagGuid !== b) {
                    c = c.firstChild;
                    for (f = 1; c;) 1 === c.nodeType && (d.getElData(c).nodeIndex = f++),
                    c = c.nextSibling;
                    g.tagGuid = b
                }
                return d.getElData(a).nodeIndex > b
            },
            "first-child": function(a) {
                for (; a = a.previousSibling;) if (1 === a.nodeType) return ! 1;
                return ! 0
            },
            "last-child": function(a) {
                for (; a = a.nextSibling;) if (1 === a.nodeType) return ! 1;
                return ! 0
            },
            "only-child": function(a) {
                for (var b = a.nextSibling,
                a = a.previousSibling; b;) {
                    if (1 === b.nodeType) return ! 1;
                    b = b.nextSibling
                }
                for (; a;) {
                    if (1 === a.nodeType) return ! 1;
                    a = a.previousSibling
                }
                return ! 0
            },
            "nth-child": function(a, b, d) {
                var c, f, g;
                if ((c = a.parentNode) && (g = d.getElData(c)).tagGuid !== b[0]) {
                    c = c.firstChild;
                    for (f = 1; c;) 1 === c.nodeType && (d.getElData(c).nodeIndex = f++),
                    c = c.nextSibling;
                    g.tagGuid = b[0]
                }
                a = d.getElData(a).nodeIndex;
                return b[1] ? (a -= b[3], b = b[2], 0 <= a * b && 0 === a % b) : a === b[2]
            },
            not: function(a, b, d) {
                for (var c = 0,
                f = b.length,
                g; c < f; c++) {
                    g = b[c];
                    if (g[1]) {
                        if ("#" + a.id !== g[1]) continue;
                        return ! 1
                    }
                    if (d.filterEl(a, g[2], g[3], g[4], g[5])) return ! 1
                }
                return ! 0
            },
            contains: function(a, b) {
                return - 1 < (a.textContent || a.innerText || "").indexOf(b)
            },
            enabled: function(a) {
                return ! 1 === a.disabled
            },
            disabled: function(a) {
                return ! 0 === a.disabled
            },
            checked: function(a) {
                return ! 0 === a.checked
            },
            empty: function(a) {
                return ! a.firstChild
            }
        }
    };
    c.Class = {
        create: function() {
            return function() {
                this.initialize.apply(this, arguments)
            }
        }
    };
    c.extend({
        initializeCore: function() {
            var a = /([^\.]+(\.com(\.cn)?|\.net(\.cn)?|\.org(\.cn)?|\.gov(\.cn)?|\.cn|\.mobi|\.tel|\.asia|\.me|\.info|\.hk|\.cc|\.biz|\.tv))$/i.exec(h.domain),
            b = /(.*\/)(.*?\.\w+)?([\?#].*)?$/ig.exec(u.protocol + "//" + h.domain + u.pathname),
            d = "";
            J = c(h);
            c("script[src*=ntkf],script[src*=base.out]").each(function(a, b) {
                if (b.src) {
                    var e = /^((https?:).*\/)?(.*?\.js)?(\?.*)?/ig.exec(b.src);
                    e && (e[1] && e[3] && /^((ntkfstat|ntkf|base\.out).*?)\.js/gi.test(e[3]) && e[4] && -1 < e[4].indexOf("siteid")) && (c.baseProtocol = e[2] || c.protocol, c.baseURI = e[1] || c.pageURI, c.baseName = e[3], d = e[4] ? e[4] : "", c.elementParent = b.parentNode, c.elementBefore = b)
                }
            });
            c.domain = a && a[0] || h.domain;
            c.pageURI = b && b[1] ? b[1] : "";
            c.pageName = b && b[2] ? b[2] : "";
            c.params = c.uriToJSON(u.search.substr(1));
            c.hash = u.hash ? u.href.substr(u.href.indexOf("#") + 1) : "";
            c.hashParams = c.uriToJSON(c.hash);
            c.loadList = y;
            c.global.connect = c.flash.support && !c.browser.mobile ? c.CON_CONNECT_FLASH: c.CON_CONNECT_COMET;
            if (c.browser.msie6) try {
                h.execCommand("BackgroundImageCache", !1, !0)
            } catch(e) {}
            for (var a = d.length ? d.substr(1).split("&") : ["lan=zh_cn", ""], f = 0; f < a.length; f++) b = a[f].split("="),
            c.extParmas[b[0]] = "lan" == b[0] ? b[1] || "zh_cn": b[1];
            c.cache.init()
        }
    });
    var s = c,
    t = r.userAgent.toLowerCase(),
    l = {
        "360ee": !1,
        lbbrowser: !1,
        se: !1,
        chrome: !1,
        safari: !1,
        msie: !1,
        firefox: !1,
        oupeng: !1,
        opera: !1,
        webkit: !1,
        iPod: !1,
        iPad: !1,
        iPhone: !1,
        android: !1,
        gecko: !1,
        windows: !1,
        "windows ce": !1,
        edge: !1
    },
    p = ["applewebkit/([^\\s]*)", "presto\\/([\\d.]*)", "trident([^;]*)", "gecko\\/([\\d.]*)", "msie ([\\d.]*)"];
    c.each(l,
    function(a) {
        l[a] = -1 < t.indexOf(a.toLowerCase())
    });
    l.ua = t;
    l.ieversion = 0;
    l.coreversion = 0;
    l.mac = !!t.match(/cpu.+mac\s+os\s+x/g);
    for (var v = 0; v < p.length; v++) RegExp(p[v], "i").test(t) && (v == p.length - 1 ? l.ieversion = +(RegExp.$1 || RegExp.$2) : l.coreversion = +RegExp.$1);
    l.ieversion = h.documentMode || l.ieversion || l.ieversion;
    l.msie = l.msie || 0 < l.ieversion;
    l.gecko = l.gecko && !l.webkit && !l.msie;
    l.msie6 = l.msie && 6 == l.ieversion;
    l.msie7 = l.msie && 7 == l.ieversion;
    l.msie8 = l.msie && 8 == l.ieversion;
    l.msie9 = l.msie && 9 == l.ieversion;
    l.msie10 = l.msie && 10 == l.ieversion;
    l.msie11 = l.msie && 11 == l.ieversion;
    l.edge = l.edge;
    l.oldmsie = l.ieversion && 9 >= l.ieversion;
    l.safari = l.safari && !l.chrome;
    l.safari2 = l.safari && !/adobeair/i.test(t);
    l.Quirks = "BackCompat" === h.compatMode;
    l.mobile = /mobile|android|linux/i.test(t);
    l.android = /android (\d.*?);/g.exec(t);
    l.oldAndroid = l.android && 4.5 > l.android.pop().substr(0, 3);
    l.iPhone6 = l.iPhone && 375 == h.body.offsetWidth;
    l.iPhone6Plus = l.iPhone && 414 == h.body.offsetWidth;
    l.iOS = "Mac68K" == r.platform || "MacPPC" == r.platform || "Macintosh" == r.platform || -1 < t.indexOf("mac");
    l.is = function(a) {
        return RegExp(a, "ig").test(t)
    };
    l.html5 = !!j.applicationCache;
    s.browser = l;
    c.extend({
        ready: function(a) {
            var b = this,
            d = h.readyState,
            e = c.browser.webkit && 525 > c.browser.version,
            f = function() {
                if (!A) { ! e && j.removeEventListener && (h.removeEventListener("DOMContentLoaded", f, !1), j.removeEventListener("load", f, !1));
                    c.isReady = A = !0;
                    for (var a = 0; a < z.length; a++) z[a].apply(h);
                    z = []
                }
            };
            A || /loaded|complete/gi.test(d) ? (c.isReady = A = !0, a.call(b)) : z[z.length] = function() {
                return a.call(b)
            };
 
        },
        require: function(a, b, d) {
            var e = [],
            f = [],
            g,
            i = null,
            k,
            m;
            a && (a = "string" === typeof a ? [a] : a, b = b || new Function, d = d || h.head || c("head")[0] || h.documentElement, k = c._getObjectNumber(a), 0 === e.length && 0 === k && b.apply(i, f), c.each(a,
            function(a, h) {
                if (h) {
                    var j, l = c.getTime(),
                    V = -1 == h.indexOf("?") ? "?": "&",
                    w = h.replace(/(.*\/)?(.*?)[\?$](.*)?/i, "$2"),
                    q = !c.isNumeric(a) ? a: "",
                    n = function() {
                        e.splice(c.inArray(h, e), 1);
                        k--;
                        0 === e.length && 0 === k && b.apply(i, f)
                    },
                    p = function(a) {
                        var a = c.Event.fixEvent(a),
                        b = a.currentTarget || a.srcElement,
                        d = /loaded|complete/gi,
                        e = b.readyState;
                        "load" === a.type || d.test(e) ? setTimeout(function() {
                            q ? (y[w] = c[q], f.push(c[q])) : (y[w] = b, f.push(b));
                            n()
                        },
                        c.browser.msie6 ? 500 : 0) : "error" === a.type && (a.error = !0, f.push(q ? !1 : a), n())
                    };
                    e.push(h);
                    w += -1 < h.indexOf("#rnd") ? String(l).substring(5, 11) : -1 < h.indexOf("#image") ? h.replace(/(.*?)\?(.*?)(#.*?)?$/gi, "-$2") : "";
                    j = /\.((gif)|(png)|(jpg)|(bmp)|(jpeg))$/i.test(h) || /#image$/ig.test(h);
                    h = h.replace(/#rnd/i, V + "ts=" + l).replace(/#image/i, "");
                    m = (!/^(https?:\/\/)/i.test(h) ? c.baseURI: "") + h;
                    q && c[q] ? (f.push(c[q]), n()) : !q && y[w] ? (f.push(y[w]), n()) : j ? i = c.preloadImage(m,
                    function(a) {
                        a.error = !1;
                        y[w] = a;
                        f.push(a);
                        n()
                    },
                    function(a) {
                        a.error = !0;
                        f.push(a);
                        n()
                    }) : (g = /\.css[^\.]*$/gi.test(h) ? {
                        tag: "link",
                        type: "text/css",
                        rel: "stylesheet",
                        href: m
                    }: {
                        tag: "script",
                        type: "text/javascript",
                        async: "async",
                        charset: "utf-8",
                        src: m
                    },
                    "script" == g.tag && q && (g["data-requiremodule"] = q), i = c(g).appendTo(d), "undefined" == typeof i.get(0).onreadystatechange ? i.bind("load", p).bind("error", p) : i.bind("readystatechange", p).bind("error", p))
                }
            }))
        },
        jsonp: function(a, b) {
            var d, e = "call_" + c.randomChar(16),
            a = a + (/\?/ig.test(a) ? "&": "?") + "callback=" + e;
            j[e] = function() {
                d = arguments;
                setTimeout(function() {
                    c.isFunction(b) && b.apply(self, d)
                },
                0);
                try {
                    delete j[e]
                } catch(a) {}
            };
            c.require(a,
            function(a) {
                c(a.error ? a.target: this).remove()
            })
        },
        preloadImage: function(a, b, d) {
            var e = this,
            b = b || new Function,
            d = d || new Function,
            f, g = new Image;
            g.src = a;
            g.setAttribute("loadTime", 0);
            if (g.complete) return b.call(c, g),
            g;
            g.onload = function() {
                clearInterval(f);
                b.call(c, this)
            };
            g.onError = function() {
                clearInterval(f);
                d.call(c, this)
            };
            f = setInterval(function() {
                g.setAttribute("loadTime", parseInt(g.getAttribute("loadTime")) + 1);
                6 <= parseInt(g.getAttribute("loadTime"), 10) && (clearInterval(f), d.call(c, e));
                if ("complete" == g.readyState || c.browser.msie7) clearInterval(f),
                g.onLoad = g.onError = null,
                b.call(c, g)
            },
            500);
            return g
        },
        _getObjectNumber: function(a) {
            if (a) {
                if (c.isArray(a)) return a.length;
                var b = 0,
                d;
                for (d in a) a.hasOwnProperty(d) && b++;
                return b
            }
            return ! 1
        }
    });
    c.cookie = {
        enable: function() {
            var a = !1;
            if (r.cookieEnabled) return ! 0;
            this.set("testcookie", "yes", 0);
            "yes" == this.get("testcookie") && (a = !0);
            this.del("testcookie");
            return a
        },
        set: function(a, b, d, e) {
            var f, b = b || "",
            e = e ? e: c.domain;
            "number" != typeof d && (d = 0);
            0 === d ? d = c.browser.msie || c.browser.mobile ? " ": "expires=0; ": (f = new Date, f.setTime(f.getTime() + d), d = f ? "expires=" + f.toGMTString() + "; ": "");
            e = "domain=" + e + "; ";
            a = a + "=" + ("" + b).replace(/\"|\'/gi, "|") + "; ";
            h.cookie = a + d + e + "path=/; ";
            return b
        },
        get: function(a) {
            var b = h.cookie;
            return b.length && (a = RegExp("(?:^|;)\\s*" + a + "=(.*?)(?:;|$)").exec(b)) && a.length ? decodeURIComponent(a[1].replace(/\|/gi, '"')) : null
        },
        del: function(a, b) {
            return this.set(a, "", 1, b)
        }
    };
    c.flash = function() {
        function a(a) {
            var b = f,
            a = (a || "0.0.0").split(".").slice(0, 3);
            return b[0] > a[0] || b[0] == a[0] && b[1] > a[1] || b[0] == a[0] && b[1] == a[1] && b[2] > a[2]
        }
        var b, d, e = !1,
        f = [0, 0, 0, 0];
        if (r.plugins && r.mimeTypes.length)(b = r.plugins["Shockwave Flash"]) && b.version ? (e = !0, f = b.version.split(".")) : b && b.description && (e = !0, f = b.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."), 3 == f.length && (f[f.length] = 0));
        else if (c.browser["windows ce"]) {
            b = 1;
            for (d = 3; b;) try {
                d++,
                b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + d),
                e = !0,
                f = [d, 0, 0]
            } catch(g) {
                b = null
            }
        } else try {
            b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),
            null !== b && (e = !0, f = b.GetVariable("$version").split(" ")[1].toString().replace(/,/g, ".").split("."))
        } catch(i) {
            e = !1
        }
        return {
            remove: function(a) {
                c(a).each(function(a, b) {
                    var d;
                    if (c.browser.msie || !b.parentNode) {
                        for (d in b) try {
                            eval("element." + d + "=null")
                        } catch(e) {}
                        d = h.createElement("DIV");
                        try {
                            d.appendChild(b),
                            d.innerHTML = "",
                            d.parentNode && d.parentNode.removeChild(d)
                        } catch(f) {}
                    } else try {
                        b.parentNode.removeChild(b)
                    } catch(g) {
                        c.Log("remove flash node failure", 3)
                    }
                })
            },
            GT: a,
            support: (0 === f.join(".").indexOf("11.6.602") || 0 === f.join(".").indexOf("11.3.300") || !a("10.3")) && c.browser.firefox || c.browser.mac ? !1 : e,
            version: f.join(".")
        }
    } ();
    var L = function(a) {
        return a === j ? "theWindow": a === h ? "theDocument": a.uniqueID
    },
    M = function(a) {
        return function(b) {
            var d = b.relatedTarget,
            c;
            if (! (c = this == d)) if (this == d) c = !1;
            else {
                for (; d && d != this;) d = d.parentNode;
                c = d == this
            }
            c || a.call(this, b)
        }
    },
    W = function() {
        this.cancelBubble = !0
    },
    X = function() {
        this.returnValue = !1
    },
    B = [];
    j.addEventListener ? (s = function(a, b, d, c) {
        "mouseenter" == b ? a.addEventListener("mouseover", M(d), c) : "mouseleave" == b ? a.addEventListener("mouseout", M(d), c) : a.addEventListener(b, d, c)
    },
    p = function(a, b, d, c) {
        a.removeEventListener(b, d, c)
    }) : (s = function(a, b, d) {
        var c = "{FNKEY::obj_" + L(a) + "::evt_" + b + "::fn_" + d + "}",
        f = B[c];
        "undefined" == typeof f && (f = function(b) {
            d.call(a, b)
        },
        B[c] = f, a.attachEvent("on" + b, f), j.attachEvent("onunload",
        function() {
            try {
                a.detachEvent("on" + b, f)
            } catch(d) {}
        }), c = null)
    },
    p = function(a, b, d) {
        var d = "{FNKEY::obj_" + L(a) + "::evt_" + b + "::fn_" + d + "}",
        c = B[d];
        "undefined" != typeof c && (a.detachEvent("on" + b, c), delete B[d])
    });
    c.Event = {
        __evtHash: B,
        addEvent: s,
        removeEvent: p,
        fixEvent: function(a) {
            if (a && a.target) return a;
            a = a || j.event;
            a.pageX = a.clientX + c(j).scrollLeft();
            a.pageY = a.clientY + c(j).scrollTop();
            a.target = a.srcElement;
            a.stopPropagation = W;
            a.preventDefault = X;
            switch (a.type) {
            case "mouseout":
                a.relatedTarget = a.toElement;
                break;
            case "mouseover":
                a.relatedTarget = a.fromElement
            }
            return a
        },
        fireEvent: function(a, b) {
            if (c.browser.msie) try {
                a.fireEvent("on" + b)
            } catch(d) {
                return ! 1
            } else {
                var e = h.createEvent("HTMLEvents");
                e.initEvent(b, !0, !0);
                try {
                    a && a.dispatchEvent(e)
                } catch(f) {}
            }
            return ! 0
        }
    };
    c.JSON = function() {
        function a(a) {
            i.lastIndex = 0;
            return i.test(a) ? '"' + a.replace(i,
            function(a) {
                var b = k[a];
                return "string" === typeof b ? b: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
            }) + '"': '"' + a + '"'
        }
        function b(c, g) {
            var i, k, h, j, l, q = d,
            n = g[c];
            "function" === typeof f && (n = f.call(g, c, n));
            switch (typeof n) {
            case "string":
                return a(n);
            case "number":
                return isFinite(n) ? String(n) : "null";
            case "boolean":
            case "null":
                return String(n);
            case "object":
                if (!n) return "null";
                d += e;
                l = [];
                if ("[object Array]" === Object.prototype.toString.apply(n)) {
                    j = n.length;
                    for (i = 0; i < j; i += 1) l[i] = b(i, n) || "null";
                    h = 0 === l.length ? "[]": d ? "[\n" + d + l.join(",\n" + d) + "\n" + q + "]": "[" + l.join(",") + "]";
                    d = q;
                    return h
                }
                if (f && "object" === typeof f) {
                    j = f.length;
                    for (i = 0; i < j; i += 1) k = f[i],
                    "string" === typeof k && (h = b(k, n)) && l.push(a(k) + (d ? ": ": ":") + h)
                } else for (k in n) n.hasOwnProperty(k) && (h = b(k, n)) && l.push(a(k) + (d ? ": ": ":") + h);
                h = 0 === l.length ? "{}": d ? "{\n" + d + l.join(",\n" + d) + "\n" + q + "}": "{" + l.join(",") + "}";
                d = q;
                return h
            }
        }
        var d, e, f, g = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        i = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        k = {
            "\b": "\\b",
            "\t": "\\t",
            "\n": "\\n",
            "\f": "\\f",
            "\r": "\\r",
            '"': '\\"',
            "\\": "\\\\"
        };
        return {
            toJSONString: function(a, d) {
                if (d && "function" !== typeof d && ("object" !== typeof d || "number" !== typeof d.length)) throw Error("JSON.toString");
                return b("", {
                    "": a
                })
            },
            parseJSON: function(a, b) {
                function d(a, c) {
                    var e, f = a[c];
                    if (f && "object" === typeof f) for (var g in f) f.hasOwnProperty(g) && (e = d(f, g), void 0 !== e ? f[g] = e: delete f[g]);
                    return b.call(a, c, f)
                }
                var e;
                if (a = String(a).replace(/\r|\n/ig, "")) try {
                    a = c.hexToDec(a)
                } catch(f) {}
                g.lastIndex = 0;
                g.test(a) && (a = a.replace(g,
                function(a) {
                    return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
                }));
                if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return e = eval("(" + a + ")"),
                "function" === typeof b ? d({
                    "": e
                },
                "") : e;
                throw new SyntaxError("JSON.toJSON");
            }
        }
    } ();
    c.HASH = c.Class.create();
    c.HASH.prototype = {
        hashTable: null,
        hashIndex: null,
        initialize: function() {
            this.hashTable = {};
            this.hashIndex = []
        },
        add: function(a, b) {
            if ("undefined" === typeof a || this.contains(a)) return ! 1;
            this.hashTable[a] = "undefined" !== typeof b ? b: null;
            this.hashIndex.push(a);
            return ! 0
        },
        remove: function(a) {
            var b = this.next(a),
            d = this.index(a);
            delete this.hashTable[a]; ! 1 !== d && this.hashIndex.splice(d, 1);
            return this.hashTable[b]
        },
        first: function() {
            for (var a in this.hashTable) if (this.hashTable.hasOwnProperty(a)) return this.hashTable[a]
        },
        last: function() {
            var a = null,
            b;
            for (b in this.hashTable) this.hashTable.hasOwnProperty(b) && (a = this.hashTable[b]);
            return a
        },
        previous: function(a) {
            var b = null,
            d;
            for (d in this.hashTable) if (this.hashTable.hasOwnProperty(d)) {
                if (d == a) break;
                b = d
            }
            return b
        },
        next: function(a) {
            var b = null,
            d = !1,
            c;
            for (c in this.hashTable) if (this.hashTable.hasOwnProperty(c)) if (b || (b = c), c == a) d = !0;
            else if (d) return c;
            return b
        },
        count: function() {
            var a = 0,
            b;
            for (b in this.hashTable) this.hashTable.hasOwnProperty(b) && a++;
            return a
        },
        items: function(a, b) {
            b && (this.hashTable[a] = b);
            return this.hashTable[a]
        },
        index: function(a) {
            for (var b = 0; b < this.hashIndex.length; b++) if (this.hashIndex[b] == a) return b;
            return ! 1
        },
        contains: function(a) {
            return "undefined" != typeof this.hashTable[a]
        },
        clear: function() {
            for (var a in this.hashTable) this.hashTable.hasOwnProperty(a) && delete this.hashTable[a];
            this.hashIndex = []
        },
        each: function(a) {
            for (var b in this.hashTable) b && this.hashTable.hasOwnProperty(b) && a.call(self, b, this.hashTable[b])
        }
    };
    c.POST = c.Class.create();
    c.POST.prototype = {
        iframeName: "",
        iframeElement: null,
        formName: "",
        formElement: null,
        hiddenElement: null,
        target: "",
        CON_TARGET: ["_blank", "_self", "_parent", "_top"],
        _stopCall: !1,
        onComplete: null,
        onFailure: null,
        _loaded: !1,
        initialize: function(a, b, d, e) {
            var b = c.merge({},
            b),
            f = c.randomChar(16);
            c.isArray(d) ? (this.onComplete = d[0] || new Function, this.onFailure = d[1] || new Function) : (this.onComplete = d || new Function, this.onFailure = new Function);
            this.target = e || "POST_IFRAME_" + f;
            this.hiddenElement = 0 < c(".nTalk_post_hiddenElement").length ? c("#nTalk_post_hiddenElement") : c({
                tag: "div",
                id: "nTalk_post_hiddenElement",
                style: "left:-10px;top:-10px;visibility:hidden;display:none;width:1px;height:1px;"
            }).appendTo(!0);
            0 > c.inArray(this.target, this.CON_TARGET) && (this.iframeName = this.target, this.iframeElement = this.createIFrame(this.iframeName, "about:blank"));
            this.formName = "POST_FORM_" + f;
            this.formElement = this.form(a, b);
            try {
                this.formElement.submit()
            } catch(g) {}
        },
        stopCall: function() {
            this._stopCall = !0
        },
        createIFrame: function(a, b) {
            var d = this,
            e, f = function(b) {
                var e = this;
                /^(?:loaded|complete|undefined)$/.test(e.readyState) && !d._loaded && (c(e).removeEvent("readystatechange", f), c(e).removeEvent("load", f), c(e).removeEvent("error", g), d._loaded = !0, d._stopCall || d.onComplete.call(d, b, a), j.frames[a] = j[a] = null, setTimeout(function() {
                    c(e).remove();
                    c(d.formElement).remove()
                },
                800))
            },
            g = function(b) {
                var e = this;
                c(e).removeEvent("readystatechange", f);
                c(e).removeEvent("load", f);
                c(e).removeEvent("error", g);
                d._stopCall || d.onFailure.call(d, b, a);
                j.frames[a] = j[a] = null;
                setTimeout(function() {
                    c(e).remove();
                    c(d.formElement).remove()
                },
                50)
            };
            if (j[a]) return j[a];
            if (j.frames[a]) return j.frames[a];
            e = c({
                tag: "IFRAME",
                name: a,
                id: a,
                src: b,
                style: "left:-10px;top:-10px;visibility:hidden;width:1px;height:1px;"
            }).appendTo(this.hiddenElement);
            c.browser.safari || e.css("position", "absolute");
            e.bind("readystatechange", f).bind("load", f).bind("error", g);
            j[a] = e.get(0);
            return j[a]
        },
        form: function(a, b) {
            var d;
            d = c({
                tag: "FORM",
                name: this.formName,
                "accept-charset": "utf-8",
                enctype: "application/x-www-form-urlencoded",
                method: "POST",
                style: "display:none;",
                target: this.target,
                action: a
            }).appendTo(this.hiddenElement);
            if (c.isArray(b)) for (var e = 0; e < b.length; e++) for (var f in b[e]) b[e].hasOwnProperty(f) && this.input(f + "[]", b[e][f], d);
            else for (e in b) if (b.hasOwnProperty(e)) if (c.isArray(b[e])) for (f = 0; f < b[e].length; f++) this.input(e + "[]", b[e][f], d);
            else this.input(e, b[e], d);
            return d.get(0)
        },
        input: function(a, b, d) {
            return c({
                tag: "INPUT",
                type: "hidden",
                name: a,
                value: encodeURIComponent(/number|string/.test(typeof b) ? b: c.JSON.toJSONString(b))
            }).appendTo(d)
        }
    };
    c.extend({
        inArray: function(a, b) {
            if ("undefined" == b.length) for (var d in b) {
                if (b.hasOwnProperty(d) && b[d] == a) return d
            } else {
                d = 0;
                for (var c = b.length; d < c; d++) if (b[d] == a) return d
            }
            return - 1
        },
        toURI: function(a, b, d) {
            var e = [],
            f = void 0 === d ? "&": d,
            d = function(d, e) {
                var i = "&" == f ? d + "=": "";
                switch (typeof a[g]) {
                case "object":
                    return e ? i + encodeURIComponent(c.JSON.toJSONString(e)) : b ? "": i;
                case "function":
                case "undefined":
                    return "";
                case "boolean":
                case "number":
                    return i + e;
                default:
                    return e ? i + encodeURIComponent(e.replace(/\+/gi, "%2B")) : b ? "": i
                }
            };
            if (c.isPlainObject(a)) for (var g in a) {
                if (a.hasOwnProperty(g)) {
                    var i = d(g, a[g]);
                    i && e.push(i)
                }
            } else return "";
            return e.join(f).replace(/%20/g, "+")
        },
        uriToJSON: function(a) {
            for (var b = {},
            a = a.toString().split("&"), d, c = 0; c < a.length; c++) if (d = a[c].split("="), !(2 > d.length)) try {
                b[d[0]] = decodeURIComponent(d[1] || "")
            } catch(f) {
                b[d[0]] = d[1]
            }
            return b
        },
        whereGetTo: function(a, b, d, e) {
            return c.merge(a, this.whereGet(b, d, e))
        },
        whereGet: function(a, b, d, e) {
            var f = {};
            if (b && c.isArray(b)) for (var g = 0,
            i = b.length; g < i; g++) d && d[g] && d[g] !== b[g] ? f[d[g]] = !c.isDefined(a[b[g]]) ? "": a[b[g]] : f[b[g]] = !c.isDefined(a[b[g]]) ? "": a[b[g]];
            else f = a;
            if (!c.isFunction(e)) return f;
            for (var h in f) f.hasOwnProperty(h) && e.call(this, f[h])
        },
        enLength: function(a) {
            try {
                return (a || "").toString().replace(/[^\x00-\xFF]/g, "**").length
            } catch(b) {
                c.Log(b, 3)
            }
        },
        enCut: function(a, b, d) {
            var e = c.enLength(a),
            b = b || 0;
            if (e < b) return "" + (a || "");
            for (var f = e = 0; f < a.length; f++) {
                e += 255 < a.charCodeAt(f) ? 2 : 1;
                if (e == b || d && e == b - 2) return a.substring(0, f + 1) + (d ? "..": "");
                if (e > b || d && e > b - 2) return a.substring(0, f) + (d ? "..": "")
            }
            return a || ""
        },
        camelize: function(a) {
            return a.replace("-ms-", "ms-").replace(T,
            function(a, d) {
                return (d + "").toUpperCase()
            })
        },
        clearHtml: function(a) {
            return (a || "").replace(U, "")
        },
        protocolFilter: function(a, b) {
            b = b || c.protocol;
            "file:" == b && (b = "http:");
            if (c.isObject(a)) {
                for (var d in a) a.hasOwnProperty(d) && (a[d] = this.protocolFilter(a[d], b));
                return a
            }
            if (c.isArray(a)) {
                for (d = 0; d < a.length; d++) a[d] = this.protocolFilter(a[d], b);
                return a
            }
            if (c.isNumeric(a) || c.isBoolean(a) || c.isFunction(a)) return a;
            if ("undefined" !== typeof a) return ! a ? a: a.toString().replace(/^https?:/ig, b).replace(/^rtmps?:/ig, "https:" == b ? "rtmps:": "rtmp:").replace(/^wss?:/ig, "https:" == b ? "wss:": "ws:")
        },
        decToHex: function(a) {
            for (var b = [], d = 0; d < a.length; d++) b[d] = /[\u4e00-\u9fa5]/i.test(a.charAt(d)) ? "\\u" + ("00" + a.charCodeAt(d).toString(16)).slice( - 4) : a.charAt(d);
            return b.join("")
        },
        hexToDec: function(a) {
            if (!a) return "";
            var b = a.match(/\\u([0-9a-zA-Z]{2,4})|&#(\d+);/gi);
            if (b) for (var d = 0; d <= b.length; d++) if (b[d]) {
                var c, f = !1;
                c = b[d].replace("\\u", "");
                for (var g = 0; g < c.length; g++) - 1 == "0123456789abcdef".indexOf(c.charAt(g)) && (f = !0);
                f || (c = String.fromCharCode(parseInt(c, 16)), a = a.replace(b[d], c))
            }
            return a
        }
    });
    c.extend({
        Element: function(a, b) {
            var d, e, f = "",
            a = a.toLocaleUpperCase();
            if ( - 1 < c.inArray(a, ["IFRAME", "FORM", "INPUT", "SELECT", "TEXTAREA"])) try {
                "FORM" == a && (f = (b.method ? ' method="' + b.method + '"': "") + (b.enctype ? ' enctype="' + b.enctype + '"': "")),
                e = "<" + a + ' name="' + (b.name || c.randomChar(16)) + '"' + f + "></" + a + ">",
                d = h.createElement(e),
                delete b.name
            } catch(g) {
                d = h.createElement(a)
            } else d = "comment" === a ? h.createComment(b.text || "") : h.createElement(a);
            b && c.each(b,
            function(a, b) {
                try {
                    switch (a) {
                    case "css":
                    case "style":
                        d.style.cssText = b;
                        break;
                    case "innerHTML":
                    case "html":
                        d.innerHTML = b;
                        break;
                    case "className":
                    case "class":
                        d.className = b;
                        break;
                    case "text":
                        d.textContent = b;
                        break;
                    default:
                        d.setAttribute(a, b)
                    }
                } catch(c) {}
            });
            return d
        },
        insert: function(a, b, d) {
            var c, a = a || h.body,
            d = d ? d.toLowerCase() : "afterbegin";
            if (a.insertAdjacentHTML) switch (d.toLowerCase()) {
            case "beforebegin":
                return a.insertAdjacentHTML("BeforeBegin", b),
                a.previousSibling;
            case "afterbegin":
                return a.insertAdjacentHTML("AfterBegin", b),
                a.firstChild;
            case "afterend":
                return a.insertAdjacentHTML("AfterEnd", b),
                a.nextSibling;
            default:
                return a.insertAdjacentHTML("BeforeEnd", b),
                a.lastChild
            }
            c = a.ownerDocument.createRange();
            switch (d) {
            case "beforebegin":
                return c.setStartBefore(a),
                b = c.createContextualFragment(b),
                a.parentNode.insertBefore(b, a),
                a.previousSibling;
            case "afterbegin":
                return a.firstChild ? (c.setStartBefore(a.firstChild), b = c.createContextualFragment(b), a.insertBefore(b, a.firstChild)) : a.innerHTML = b,
                a.firstChild;
            case "beforeend":
                return a.lastChild ? (c.setStartAfter(a.lastChild), b = c.createContextualFragment(b), a.appendChild(b)) : a.innerHTML = b,
                a.lastChild;
            case "afterend":
                return c.setStartAfter(a),
                b = c.createContextualFragment(b),
                a.parentNode.insertBefore(b, a.nextSibling),
                a.nextSibling
            }
            throw 'Illegal insertion point -> "' + d + '"';
        },
        flashHtml: function(a, b, d, e) {
            e = c.extend({
                width: 1,
                height: 1,
                style: "",
                wmode: "opaque"
            },
            e);
            if (c.browser.oldmsie) var f = -1 < b.indexOf("?") ? "&": "?",
            b = b + (f + "rnd=" + Math.floor(1E3 * Math.random()));
            return c.browser.msie && 11 > c.browser.ieversion ? ['<object id="', a, '" name="', a, '" width="', e.width, '" height="', e.height, '" style="', e.style, '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28"><param name="wmode" value="', e.wmode, '" /><param name="movie" value="', b, '" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="', c.toURI(d, !0), '" /></object>'].join("") : c.browser.msie && 11 <= c.browser.ieversion ? ['<object id="', a, '"  name="', a, '" data="', b, '" width="', e.width, '" height="', e.height, '" style="', e.style, '" type="application/x-shockwave-flash"><param name="wmode" value="', e.wmode, '"/><param name="movie" value="', b, '"/><param name="quality" value="high"/><param name="allowscriptaccess" value="always"/><param name="flashvars" value="', c.toURI(d, !0), '"/></object>'].join("") : ['<embed id="', a, '" name="', a, '" src="' + b + '" width="', e.width, '" height="', e.height, '" style="', e.style, '" flashvars="', c.toURI(d, !0), '" wmode="', e.wmode, '" allowscriptaccess="always" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>'].join("")
        },
        _vendorPropName: function(a, b) {
            if (b in a) return b;
            for (var d = ["Webkit", "O", "Moz", "ms"], c = b.charAt(0).toUpperCase() + b.slice(1), f = b, g = d.length; g--;) if (b = d[g] + c, b in a) return b;
            return f
        },
        css: function(a, b, d) {
            var e = /\s*alpha\(opacity=([^)]*)\)\s*/gi;
            if (!a) return ! 1;
            if (void 0 === d) {
                d = c.camelize(b);
                if (h.defaultView && h.defaultView.getComputedStyle) return d = h.defaultView.getComputedStyle(a, null).getPropertyValue(b),
                "auto" === d || "" === d ? 0 : d;
                b = c.cssProps[d] || c._vendorPropName(a.style, d);
                d = "opacity" === b ? /opacity=([^)]*)/.test(a.currentStyle.filter) ? 0.01 * parseFloat(RegExp.$1) + "": 1 : a.style[b] || (a.currentStyle ? a.currentStyle[b] : null);
                "backgroundPosition" === b && (c.browser.msie && 8 >= c.browser.ieversion) && (d = a.style[b + "X"] || (a.currentStyle ? a.currentStyle[b + "X"] : null), d = d + " " + a.style[b + "Y"] || (a.currentStyle ? a.currentStyle[b + "Y"] : null));
                return "auto" === d ? 0 : d
            }
            if (void 0 !== h.documentElement.style.opacity) try {
                a.style[c.camelize(b)] = d
            } catch(f) {
                return ! 1
            } else {
                if (!a.currentStyle || !a.currentStyle.hasLayout) a.style.zoom = 1;
                if ("opacity" === b) {
                    try {
                        a.style.filter = 1 == d ? "none": (a.currentStyle || a.style).filter.replace(e, "") + " alpha(opacity=" + 100 * d + ")"
                    } catch(g) {}
                    a.style.zoom = 1
                } else try {
                    a.style[c.camelize(b)] = d
                } catch(i) {
                    return ! 1
                }
            }
            return ! 0
        },
        attr: function(a, b, d) {
            if (a) return "undefined" != typeof d ? ("" === d ? a.removeAttribute(b) : a.setAttribute(b, d), d) : a.getAttribute ? a.getAttribute(b) : a[b] || ""
        },
        addClass: function(a, b) {
            if (!a || this.indexOfClass(a, b)) return ! 1;
            var d = a.className.split(/\s+/).join(" ");
            a.className = (d ? d + " ": "") + b;
            return ! 0
        },
        removeClass: function(a, b) {
            if (!a || !a.className) return ! 1;
            a.className = a.className.replace(RegExp("(^|\\s+)" + b + "(\\s+|$)", "i"), " ");
            return ! 0
        },
        indexOfClass: function(a, b) {
            return ! a || !a.className ? !1 : RegExp("(^|\\b)" + b + "(\\s|$)", "gi").test(a.className)
        },
        contains: function(a, b) {
            if (b) for (; b = b.parentNode;) if (b === a) return ! 0;
            return ! 1
        }
    });
    c.position = c.Class.create();
    c.position.prototype = {
        defaultOptions: {
            left: null,
            top: null,
            width: null,
            height: null,
            right: null,
            bottom: null,
            fixed: !0,
            resize: !1
        },
        timer: 0,
        repwidth: "",
        repheight: "",
        inited: !1,
        direction: "left",
        initialize: function(a, b) {
            var d;
            c.extend(this, this.defaultOptions, b);
            this.element = a.talkVersion ? a: c(a);
            this.width ? "auto" == this.width && (this.repwidth = "auto", this.width = this.element.width()) : this.width = this.element.width();
            this.height ? "auto" == this.height && (this.repheight = "auto", this.height = this.element.height()) : this.height = this.element.height();
            this.offset = c(j).offset();
            this.quirks = c.browser.msie6 || c.browser.Quirks && c.browser.oldmsie;
            null === this.left && (this.direction = "right");
            null === this.left && null === this.right && (d = this.element.offset(), this.left = d.left, this.top = d.top);
            this.right = null === this.right ? c(j).width() - this.left - this.width: this.right;
            this.bottom = null === this.bottom ? c(j).height() - this.top - this.height: this.bottom;
            this.left = null === this.left ? c(j).width() - this.right - this.width: this.left;
            this.top = null === this.top ? c(j).height() - this.bottom - this.height: this.top;
            this.fixed ? this.fixedPosition({
                left: this.left,
                top: this.top,
                right: this.right,
                bottom: this.bottom
            }) : this.animationPosition()
        },
        fixedPosition: function(a) {
            var b = this,
            d, e;
            this.quirks ? (d = c(j).offset(), e = c(j).scrollTop(), this.element.css({
                position: "absolute",
                width: this.repwidth ? this.repwidth: this.width + "px",
                height: this.repheight ? this.repheight: this.height + "px",
                left: a.left + d.left + "px",
                top: a.top + d.top + "px"
            }), d = ["expression(eval(Math.max((document.documentElement.scrollLeft || document.body.scrollLeft), (document.documentElement.scrollLeft || document.body.scrollLeft) + " + a.left + ")))", "expression(eval(Math.max((document.documentElement.scrollLeft || document.body.scrollLeft), (document.documentElement.scrollLeft || document.body.scrollLeft) + (document.documentElement.clientWidth  || document.body.clientWidth ) - this.offsetWidth  - " + a.right + ")))"], a = ["expression(eval(Math.max((document.documentElement.scrollTop  || document.body.scrollTop ), (document.documentElement.scrollTop  || document.body.scrollTop ) + " + a.top + ")))", "expression(eval(Math.max((document.documentElement.scrollTop  || document.body.scrollTop ), (document.documentElement.scrollTop  || document.body.scrollTop ) + (document.documentElement.clientHeight || document.body.clientHeight) - this.offsetHeight - " + a.bottom + ")))"], c.isFunction(this.element.get(0).style.getExpression) ? "left" == this.direction ? (this.element.Expression("left", d[0]), this.element.Expression("top", a[0])) : (this.element.Expression("left", d[1]), this.element.Expression("top", a[1])) : (c(j).scrollTop(e + 1), "left" == this.direction ? this.element.replaceIEcssText({
                left: d[0],
                top: a[0]
            }) : this.element.replaceIEcssText({
                left: d[1],
                top: a[1]
            }), c(j).scrollTop(e))) : (d = {
                position: "fixed",
                width: this.repwidth ? this.repwidth: this.width + "px",
                height: this.repheight ? this.repheight: this.height + "px"
            },
            "left" == this.direction ? (d.left = a.left + "px", d.top = a.top + "px") : (d.right = a.right + "px", d.bottom = a.bottom + "px"), this.element.css(d));
            this.resize && !this.inited && c.Event.addEvent(j, "resize",
            function(a) {
                b.resizeFixed(a)
            });
            this.inited = !0
        },
        resizeFixed: function() {
            var a = [];
            if ("left" == this.direction) a.left = Math.max(0, Math.min(this.left, c(j).width() - this.width)),
            a.top = Math.max(0, Math.min(this.top, c(j).height() - this.height)),
            a.right = c(j).width() - a.left - this.width,
            a.bottom = c(j).height() - a.top - this.height;
            else if (a.right = Math.min(this.right, c(j).width() - this.width), a.bottom = Math.min(this.bottom, c(j).height() - this.height), a.left = c(j).width() - a.right - this.width, a.top = c(j).height() - a.bottom - this.height, 0 > a.left || 0 > a.top) a.left = Math.max(0, a.left),
            a.top = Math.max(0, a.top),
            a.right = c(j).width() - a.left - this.width,
            a.bottom = c(j).height() - a.top - this.height;
            this.fixedPosition(a)
        },
        clearExpression: function() {
            if (this.quirks) {
                var a = c(j).offset();
                this.element.Expression("left", "");
                this.element.Expression("top", "");
                this.element.css({
                    left: this.left + a.left + "px",
                    top: this.top + a.top + "px"
                })
            }
        },
        animationPosition: function() {}
    };
    c.extend({
        myString: function(a) {
            a = new String("" + a);
            a.trim = function() {
                return this.replace(/(^\s*)|(\s*$)/g, "")
            };
            a.linkFilter = function(a) {
                return this.toString().replace(/((\w+):\/\/)?([\w-]+\.)([\w-]+\.)([a-zA-Z\-_\.]+)([^$\s,\"\u4E00-\u9FA5]*)?/ig,
                function(d, c, f, g, i, h, j) {
                    return '<a href="' + ((c || "http://") + (g || "") + i + h + (j || "")).replace(/(^\s+)|(\s+$)/gi, "") + '" target="_blank" style="' + (a || "") + '">' + (c || "") + (g || "") + i + h + (j || "") + "</a>"
                })
            };
            a.linkFilter1 = function(a) {
                return this.toString().replace(/((\w+):\/\/)?([\w-]+\.)([\w-]+\.)([a-zA-Z\-_\.]+)([^$\s,\uFF0C\u3002\"\u4E00-\u9FA5]*)?/ig,
                function(d, e, f, g, h, k, j) {
                    d = ((e || "http://") + (g || "") + h + k + (j || "")).replace(/(^\s+)|(\s+$)/gi, "");
                    f = "" + c.randomChar(16);
                    return ['<div style="', c.STYLE_BODY, '"><a href="', d, '" target="_blank" style="', a || "", '">', e || "", g || "", h, k, j || "", '</a></div><div class="ntalk-link-contains ', f, '" data-source="', d, '" style="', a, '"></div>'].join("")
                })
            };
            a.sprintf = function() {
                var a = arguments.length,
                d = this;
                if (1 > a || !RegExp) return d.toString();
                for (var c = 0; c < a; c++) d = d.replace(RegExp("%" + (c + 1), "g"), (arguments[c] + "").replace(/%\d/g, "").toString());
                return d
            };
            return a
        },
        cssNumber: {
            columnCount: !0,
            fillOpacity: !0,
            fontWeight: !0,
            lineHeight: !0,
            opacity: !0,
            zIndex: !0,
            zoom: !0
        },
        cssProps: {
            "float": "cssFloat"
        },
        unit: function(a, b) {
            if (this.cssNumber[a]) return "";
            var d = (b + "").replace(S, "");
            return "" === d ? "px": d
        },
        valHooks: {
            option: {
                get: function(a) {
                    return a.value || a.text
                }
            },
            select: {
                get: function(a) {
                    var b, d, e = a.selectedIndex,
                    f = [],
                    g = a.options,
                    h = "select-one" === a.type;
                    if (0 > e) return null;
                    a = h ? e: 0;
                    for (d = h ? e + 1 : g.length; a < d; a++) if (b = g[a], b.selected && null === b.getAttribute("disabled") && !b.parentNode.disabled && "OPTGROUP" !== b.parentNode.tagName.toUpperCase()) {
                        b = c(b).val();
                        if (h) return b;
                        f.push(b)
                    }
                    return h && !f.length && g.length ? c(g[e]).val() : f
                },
                set: function(a, b) {
                    var d = c.isArray(b) ? b: [b];
                    c(a).find("option").each(function() {
                        this.selected = 0 <= c.inArray(c(this).val(), d)
                    });
                    d.length || (a.selectedIndex = -1);
                    return d
                }
            }
        }
    });
    c.each(["radio", "checkbox"],
    function(a, b) {
        c.valHooks[b] = {
            get: function(a) {
                return null === a.getAttribute("value") ? "on": a.value
            }
        }
    });
    c.each(["radio", "checkbox"],
    function(a, b) {
        c.valHooks[b] = c.extend(c.valHooks[b], {
            set: function(a, b) {
                a.checked = 0 <= c.inArray(c(a).val(), b);
                return a.checked
            }
        })
    });
    c.fn.extend({
        bind: function(a, b) {
            return c.access(this,
            function(a, b, f) {
                c.Event.addEvent(a, b, f)
            },
            a, b, 1)
        },
        addEvent: function(a, b) {
            return this.bind(a, b)
        },
        click: function(a) {
            return this.bind("click", a)
        },
        hover: function(a, b) {
            return c.access(this,
            function(a, b, f) {
                c.Event.addEvent(a, "mouseover", b);
                c.Event.addEvent(a, "mouseout", f);
                return c(a)
            },
            a, b || new Function)
        },
        removeEvent: function(a, b) {
            return c.access(this,
            function(a, b, f) {
                void 0 === f ? a.onclick = null: c.Event.removeEvent(a, b, f)
            },
            a, b, 1)
        },
        fire: function(a) {
            return c.access(this,
            function(a, d) {
                c.Event.fireEvent(a, d)
            },
            a, "", 1)
        },
        insert: function(a, b) {
            return c(c.insert(this[0], a, b))
        },
        html: function(a, b) {
            return void 0 !== a ? c.each(this,
            function(b, c) {
                c.innerHTML = a
            }) : c.isBoolean(b) && b ? (this.length ? this.get(0).innerHTML: "").replace(/(^\s+)|(\s+$)/gi, "") : this.length ? this.get(0).innerHTML: ""
        },
        append: function(a) {
            return c.each(this,
            function(b, d) {
                c.insert(d, a, "beforeend")
            })
        },
        appendTo: function(a, b) {
            var d, e = h.body || c("body")[0] || h.documentElement;
            "boolean" == typeof a && (b = a, a = null);
            d = !a || "string" == typeof a ? c(a || e)[0] : a.talkVersion ? a.length ? a[0] : c(e)[0] : a;
            return c.each(this,
            function(a, e) {
                var h = d.tagName.toLocaleUpperCase();
                if (b && b.talkVersion && b.length) return d.insertBefore(e, b.get(0));
                if (b && 1 == b.nodeType) return d.insertBefore(e, b);
                if (!0 === b) return d.insertBefore(e, d.firstChild);
                if (A || "BODY" != h) try {
                    return d.appendChild(e)
                } catch(j) {} else return c.insert(d, e.outerHTML, "beforeend")
            })
        },
        replace: function(a) {
            c.each(this,
            function(b, d) {
                if (d.replaceNode) d.replaceNode(a);
                else try {
                    d.parentNode.appendChild(a),
                    d.parentNode.removeChild(d)
                } catch(c) {}
            });
            return c(a)
        },
        find: function(a) {
            a = this.constructor.selector.query(a, this);
            return this.pushStack(a)
        },
        parent: function(a) {
            var b = this.get(0),
            a = a || 1;
            if (!b || !b.parentNode || !this.length) return null;
            for (; 0 < a && b.parentNode && 11 !== b.parentNode.nodeType;) b = b.parentNode,
            a--;
            return b ? c(b) : null
        },
        child: function() {
            return this.find("*")
        },
        remove: function() {
            return c.each(this,
            function(a, b) {
                var d = !1,
                e;
                for (e in b) if ("IFRAME" != b.tagName.toUpperCase()) try {
                    "function" === typeof b[e] && (b[e] = null)
                } catch(f) {
                    c.Log("remove(" + b.tagName + "):" + f.message, 3)
                }
                if (b.parentNode) try {
                    b.parentNode.removeChild(b),
                    d = !0
                } catch(g) {}
                if (!d) {
                    d = h.createElement("DIV");
                    try {
                        d.appendChild(b),
                        d.innerHTML = "",
                        d.parentNode && d.parentNode.removeChild(d)
                    } catch(i) {}
                }
            })
        },
        css: function(a, b) {
            return c.access(this,
            function(a, b, f) {
                return void 0 !== f ? c.css(a, b, f) : c.css(a, b)
            },
            a, b, 1 < arguments.length)
        },
        cssText: function(a) {
            return c.access(this,
            function(a, c, e) {
                return void 0 !== e ? a.style.cssText = e: a.style.cssText
            },
            "", a, 1 < arguments.length)
        },
        attr: function(a, b) {
            return c.access(this,
            function(a, b, f) {
                return void 0 !== f ? c.attr(a, b, f) : c.attr(a, b)
            },
            a, b, 1 < arguments.length)
        },
        display: function(a) {
            return c.each(this,
            function(b, d) {
                c.css(d, "display", a ? "block": "none")
            })
        },
        replaceIEcssText: function(a, b) {
            return c.access(this,
            function(a, b, c) {
                var g = ";" + a.style.cssText,
                h = RegExp(";\\s*" + b + ":\\s*(.*?);", "ig"),
                b = ";" + b + ":" + (c || "") + ";";
                a.style.cssText = h.test(g) ? g.replace(h, b) : g + b
            },
            a, b, 1 < arguments.length)
        },
        Expression: function(a, b) {
            return c.access(this,
            function(a, b, c) {
                if ("getExpression" in a.style) return void 0 === c ? a.style.getExpression(b) : "" === c ? a.style.removeExpression(b) : a.style.setExpression(b, c)
            },
            a, b, 1 < arguments.length)
        },
        curClass: function() {
            return this.length ? this.get(0).className: ""
        },
        addClass: function(a) {
            return c.each(this,
            function(b, d) {
                c.addClass(d, a)
            })
        },
        removeClass: function(a) {
            return c.each(this,
            function(b, d) {
                c.removeClass(d, a)
            })
        },
        indexOfClass: function(a) {
            return c.indexOfClass(this[0], a)
        },
        replaceClass: function(a, b) {
            return c.each(this,
            function(d, e) {
                c.addClass(e, a);
                c.removeClass(e, b)
            })
        },
        val: function(a) {
            if (!this.length) return "";
            var b, d, e;
            e = this[0];
            if (arguments.length) return c.each(this,
            function(d, e) {
                null === a && (a = "");
                b = c.valHooks[e.type] || c.valHooks[e.nodeName.toLowerCase()];
                if (!b || !("set" in b) || void 0 === b.set(this, a, "value")) e.value = a
            });
            if ((b = c.valHooks[e.nodeName.toLowerCase()]) && "get" in b && void 0 !== (d = b.get(e, "value"))) return d;
            if ((b = c.valHooks[e.type]) && "get" in b) {
                e = "radio" == this[0].type;
                for (var f = [], g = 0; g < this.length; g++) if (void 0 !== (d = b.get(this[g], "value")) && this[g].checked) {
                    if (e) return d;
                    f.push(d)
                }
                return e ? "": f
            }
            d = this[0].value;
            return "string" === typeof d ? d: null === d ? "": d
        },
        width: function(a) {
            var b;
            if (0 < this.length) b = this[0];
            else return 0;
            return c.isWindow(b) ? c.browser.Quirks && !c.browser.msie ? h.documentElement.clientWidth: h.documentElement.clientWidth || h.body.clientWidth || j.innerWidth: void 0 === a ? b.offsetWidth: b.offsetWidth = a
        },
        height: function(a) {
            var b;
            if (this.length) b = this[0];
            else return 0;
            return c.isWindow(b) ? c.browser.Quirks && !c.browser.msie ? j.innerHeight: h.documentElement.clientHeight || h.body.clientHeight || j.innerHeight: void 0 === a ? b.offsetHeight: b.offsetHeight = a
        },
        scrollHeight: function(a) {
            var b;
            if (this.length) b = this[0];
            else return 0;
            if (c.isWindow(b)) return j.innerHeight || h.documentElement.scrollHeight || h.body.scrollHeight;
            try {
                return void 0 === a ? b.scrollHeight: b.scrollHeight = a
            } catch(d) {
                return 0
            }
        },
        scrollLeft: function(a) {
            var b;
            if (this.length) b = this[0];
            else return 0;
            if (c.isWindow(b)) if (void 0 === a) try {
                return Math.max(h.documentElement.scrollLeft || j.pageXOffset, h.body ? h.body.scrollLeft: 0) || 0
            } catch(d) {
                return 0
            } else h.documentElement.scrollLeft = a,
            h.body.scrollLeft = a;
            else return void 0 === a ? b.scrollLeft: b.scrollLeft = a
        },
        scrollTop: function(a) {
            var b;
            if (this.length) b = this[0];
            else return 0;
            if (c.isWindow(b)) {
                if (void 0 === a) return h.documentElement.scrollTop || j.pageYOffset || h.body.scrollTop;
                h.documentElement.scrollTop = a;
                h.documentElement.scrollTop != a && (h.body.scrollTop = a)
            } else return void 0 === a ? b.scrollTop: b.scrollTop = a
        },
        offset: function(a) {
            if (arguments.length) return void 0 === a ? this: this.each(function(b, d) {
                c.offset.setOffset(d, a, b)
            });
            var b, d = this[0],
            e = {
                top: 0,
                left: 0
            };
            b = d && d.ownerDocument;
            if (c.isWindow(d)) return {
                top: c(d).scrollTop(),
                left: c(d).scrollLeft()
            };
            if (!b) return e;
            b = b.documentElement;
            if (!c.contains(b, d)) return e;
            "undefined" !== typeof d.getBoundingClientRect && (e = d.getBoundingClientRect());
            return {
                top: e.top + c(j).scrollTop() - b.clientTop,
                left: e.left + c(j).scrollLeft() - b.clientLeft
            }
        },
        fixed: function(a) {
            return c.each(this,
            function(b, d) {
                new c.position(d, a)
            })
        }
    });
    c.offset = {
        setOffset: function(a, b) {
            var d, e, f;
            d = c.css(a, "position");
            var g = c(a),
            h = {};
            "static" === d && (a.style.position = "relative");
            e = g.offset();
            d = c.css(a, "top");
            f = c.css(a, "left");
            null !== b.top && (h.top = b.top - e.top + (d || 0));
            null !== b.left && (h.left = b.left - e.left + (f || 0));
            g.css(h)
        }
    };
    c.cache = {
        data: null,
        init: function() {
            c.cache.data = c.extend({},
            c.cache.deserialize(c.cookie.get(c.CON_CACHE_COOKIE)))
        },
        get: function(a, b) { ! 0 === b && (c.cache.data = c.merge(c.cache.data, c.cache.deserialize(c.cookie.get(c.CON_CACHE_COOKIE))));
            return this.formatData(a)
        },
        set: function(a, b) {
            this.formatData(a, b);
            return c.cookie.set(c.CON_CACHE_COOKIE, c.cache.serialize(c.cache.data), 0)
        },
        serialize: function(a) {
            var b = this,
            d = [];
            if (c.isArray(a)) {
                for (var e = 0; e < a.length; e++) d.push(this.serialize(a[e]));
                return "[" + d.join("|") + "]"
            }
            return c.isObject(a) ? (c.each(a,
            function(a, c) {
                d.push(a + ":" + b.serialize(c))
            }), d.length ? "{" + d.join(",") + "}": "{}") : a
        },
        deserialize: function(a) {
            if (!a) return {};
            var b, a = /"/.test(a) ? a: a.replace(/(\{|\[)/g, '$1"').replace(/(}|])/g, '"$1').replace(/(:|,)/g, '"$1"');
            try {
                b = c.JSON.parseJSON(a)
            } catch(d) {
                return null
            }
            for (var e in b) b.hasOwnProperty(e) && (b[e] = c.isNumeric(b[e]) ? +b[e] : b[e]);
            return b
        },
        formatData: function(a, b) {
            for (var d = a.split("."), e = c.cache.data, f; f = d.shift();) if (0 < d.length) e[f] || (e[f] = {}),
            e = e[f];
            else {
                if (void 0 === b) return e[f] || null;
                if (c.isArray(b)) {
                    var g = [];
                    e[f] && (g = g.concat(e[f]));
                    e[f] = g.concat(b)
                } else return e[f] = b,
                c.cache.data
            }
        }
    };
    var s = c,
    p = function() {
        F = !0;
        100 > c.getTime() - N || (N = c.getTime(), G && O(), c.isFunction(c.promptwindow.callbackFocus) && c.promptwindow.callbackFocus())
    },
    v = function() {
        F = !1;
        c.isFunction(c.promptwindow.callbackBlur) && c.promptwindow.callbackBlur()
    },
    Y = function() {
        D++;
        h.title = 0 === D % 2 ? x: H;
        try {
            top != self && (top.document.title = 0 === D % 2 ? x: H)
        } catch(a) {}
    },
    O = function() {
        if (E && (clearInterval(I), I = null, D = 0, setTimeout(function() {
            h.title = C
        },
        500), E = !1, j.top != j.self)) try {
            j.top.document.title = C
        } catch(a) {}
    },
    F = !1,
    E = !1,
    N = c.getTime(),
    I = null,
    H = null,
    x = null,
    C = h.title,
    D = 0,
    G = !0;
    j.addEvent && (c(h).bind("focusin", p), c(h).bind("focusout", v));
    c(j).bind("focus", p);
    c(j).bind("blur", v);
    p = {
        callbackFocus: new Function,
        callbackBlur: new Function,
        originTitle: C,
        startPrompt: function(a, b, d) {
            if (!E && !F) {
                if (b && 0 < b.length) {
                    H = c.myString("\u3010%1\u3011%2 - %3").sprintf(b, "", C);
                    x = "";
                    for (var e = 0,
                    b = Math.ceil(c.enLength(b) / 2); e < b; e++) x += "\u3000";
                    x = c.myString("\u3010%1\u3011%2 - %3").sprintf(x, a, C)
                }
                G = d || G;
                I = setInterval(Y, 800);
                return E = !0
            }
        },
        stopPrompt: O
    };
    s.promptwindow = p;
    j.nTalk || (j.nTalk = j.NTKF = c, c.initializeCore())
})(window);

/* @file flashserver
 * @date 2016.04.28 04:36:00
 */
(function($) {
    $.flashserver = {
        'trailserver': 'http://nt-trail.17ugo.cn:8443/trail/trail',
        'presenceserver': 'rtmp://nt-im.17ugo.cn:83/flashIM',
        'presencegoserver': 'http://nt-im.17ugo.cn:8088/flashIM/wdkstatus',
        'crmcenter': 'http://nt-crmcentert.17ugo.cn/',
        'mcenter': 'http://nt-mcenter6.17ugo.cn/',
        'coopserver': '',
        'roboturl': 'http://nt-chat.17ugo.cn:18001/chat/RobotService',
        't2dstatus': 'http://nt-t2d.17ugo.cn:8000/t2d/t2dstatus',
        'chatview_in': '',
        'chatview_out': '',
        'chatview_wap': '',
        'queryurl': 'http://spider.ntalker.com:8080/spider/',
        'tchatmqttserver': 'tcp://nt-mqtt.17ugo.cn:8084/TCHAT;ws://nt-mqtt.17ugo.cn:8083/TCHAT',
        'isnoim': 0,
        'notrail': 0,
        'preload': 0,
        'sessioncarry': '1',
        'enable_entrance': '1',
        'enable_invite': '0',
        'close_tchat_flash': '1',
        'close_im_flash': '0',
        'robot': '0',
        'connect_type': 'mqtt',
        'entranceConfig': {},
        'siteid': 'kf_9715'
    };
    $.sourceURI = $.baseURI + "siteid/respack_nt6.1.10.1/";
})(nTalk);

/* @file trail.js
 * @date 2016.04.28 03:23:07 
 */
(function(a) {
    a.trail || (a.trail = {
        _trailServer: {
            kf_9988: "http://trailsvc.ntalker.com/trailsvc/count/trail.php?"
        },
        islogin: !1,
        called: !1,
        etype: "pv",
        edata: "",
        start: function(c, b) {
            var d = this,
            e, f;
            e = a.referrer && -1 < a.referrer.indexOf(a.domain);
            if (!this.called || b) a.Log("nTalk.trail.start()", 1),
            this.etype = b ? "update": this.etype,
            this.islogin = c || "" === a.global.trailid || !e ? 1 : 0,
            e = this.formartData(),
            !a.isEmptyObject(a.global.ntalkerparam) && a.global.ntalkerparam && (f = a.extend({},
            {
                ntalkerparam: a.global.ntalkerparam
            })),
            a.each(e,
            function(c, b) {
                b.ts = a.getTime();
                d.request(d.formatURI() + a.toURI(b), f,
                function(b) {
                    a.Log(b, 1)
                },
                c)
            }),
            this.called = !0
        },
        request: function(c, b, d, e) {
            b && b.hasOwnProperty("ntalkerparam") && !a.isEmptyObject(b.ntalkerparam) ? (a.Log("nTalk.trail.request():etype:" + this.etype + ";POST request URI:" + c), new a.POST(c, b,
            function(a, b) {
                d.call(nTalk, "nTalk.trail: iframe[" + b + "] post complete.", 1)
            },
            "POST_IFRAME_" + e)) : (a.Log("nTalk.trail.request():etype:" + this.etype + ";POST request URI:" + c), a.require(c,
            function() {
                d.call(nTalk, "nTalk.trail: script get complete.", 1)
            }))
        },
        formatURI: function() {
            return this._trailServer[a.global.siteid] ? a.protocolFilter(this._trailServer[a.global.siteid]) : a.protocolFilter(a.server.trailserver + "/userinfo.php?")
        },
        formartData: function() {
            var c = [],
            b,
            d = {
                action: "save",
                url: a.url,
                siteid: a.global.siteid,
                uid: a.user.id,
                uname: a.user.name,
                device: a.browser.mobile ? "WAP": "PC",
                isvip: a.global.isvip,
                userlevel: a.global.userlevel,
                cid: a.global.pcid,
                sid: a.global.trailid,
                log: this.islogin,
                pageid: a.base.pageid,
                etype: this.etype,
                edata: this.edata
            };
            a.global.pagetype && (d.url = -1 == a.url.indexOf("#") ? d.url + ("#ntalker-pagetype=" + a.global.pagetype) : -1 == a.url.indexOf("?") ? a.enCut(a.url.replace(/#/i, "?ntalker-pagetype=" + a.global.pagetype + "#"), 255) : a.enCut(a.url.replace(/#/i, "&ntalker-pagetype=" + a.global.pagetype + "#"), 255));
            1 == this.islogin && (a.cache.set("tid", a.global.trailid), d = a.merge(d, {
                lan: a.language,
                scr: screen.width + "*" + screen.height,
                cookie: a.cookie.enable() ? 1 : 0,
                flash: a.flash.version
            }));
            a.Log("nTalk.trail: " + (this.islogin ? "LOGIN": "LINK") + " trailid:" + a.global.trailid + ", uid:" + a.user.id + ", pcid:" + a.global.pcid, this.islogin ? 1 : 0);
            a.global.orderid.length ? a.each(a.global.orderid,
            function(e, f) {
                b = e > a.global.orderprice.length - 1 ? "": a.global.orderprice[e];
                c.push(a.merge({},
                d, {
                    orderid: f,
                    orderprice: b,
                    sellerid: a.global.sellerid[e] || "",
                    ttl: a.global.title,
                    ref: a.referrer
                }))
            }) : c.push(a.merge({},
            d, {
                sellerid: a.global.sellerid.length ? a.global.sellerid[0] : "",
                ttl: a.global.title,
                ref: a.referrer
            }));
            return c
        }
    })
})(nTalk);

/* @file base.js
 * @date 2016.04.28 03:22:27 
 */
(function(a) {
    var p = ["kf_9933", "kf_9949", "kf_9954"],
    q = {
        trailserver: "",
        presenceserver: "",
        presencegoserver: "",
        crmcenter: "",
        mcenter: "",
        coopserver: "",
        roboturl: "",
        t2dstatus: "",
        isnoim: 0,
        notrail: 0,
        preload: 2E3,
        sessioncarry: "1",
        enable_entrance: "0",
        enable_invite: "0",
        close_tchat_flash: "1",
        close_im_flash: "0",
        robot: "0",
        siteid: ""
    },
    r = /[a-z]{2}\_\d+/ig;
    if (a.baseURI && !a.base) {
        a.extend({
            CON_LOAD_MODE_NID: 1,
            CON_CUSTOMER_ID: 0,
            CON_GROUP_ID: 1,
            CON_VISITOR_ID: 2,
            CON_SHORT_ID: 3
        });
        a.base = {
            _startBase: !1,
            _identityIDReady: !1,
            _connectTimeID: null,
            chatLoading: !1,
            clearChatCache: !1,
            timeOut: 2E3,
            entityList: {
                "<": "&lt;",
                ">": "&gt;"
            },
            fieldList: "shortid uid uname isvip userlevel itemid itemparam erpparam exparams".split(" "),
            CON_LOCAL_FIX: "NOWAIT_",
            call_trail_status: !1,
            userIdFix: "",
            _reload_trail: !1,
            _get_page_data: null,
            config: null,
            _islogin: !0,
            start: function() {
                var b = this;
                a.server ? (a.Log("nTalk.base.start()", 1), a.cookie.enable() || a.Log("Does not support cookies!", 3), a.global.pageinchat = !0, a.global.statictis = 2, a.source = a.url, this._identityIDReady = !1, this._startBase || (this.pageid = a.getTime(), this._startBase = !0, this._loadFlashServer(), a.isEmptyObject(CON_RULE) ? (this.getPageData(), this._loadIdentityID(function(c, d) {
                    a.Log("PCID:" + d, 1);
                    b.startOtherMode(c, d)
                })) : this.startData(function() {
                    this._loadIdentityID(function(c, d) {
                        a.Log("PCID:" + d, 1);
                        b.startOtherMode(c, d)
                    })
                }))) : a.Log("Loaded $server mode failed", 3)
            },
            chanageUserID: function() {
                return "undefined" == typeof NTKF_PARAM ? !1 : NTKF_PARAM.uid && this.toLongID(NTKF_PARAM.uid) && this.toLongID(NTKF_PARAM.uid) != a.user.id ? -1 < a.inArray(a.global.siteid, p) && a.global.siteid + "_ISME9754_" + NTKF_PARAM.uname == a.user.id ? !1 : !0 : !1
            },
            overloadedData: function(b, c) {
                a.isFunction(b) && (c = b, b = null);
                a.Log("nTalk.base.overloadedData()");
                a.isEmptyObject(CON_RULE) ? (this.getPageData(b), a.user.id = a.global.uid || a.user.id, a.user.name = a.global.uname || "", a.cache.set("uid", a.user.id), a.isFunction(c) && c(), a.base.startTrail(a.base._islogin, !0)) : this.startData(function() {
                    a.user.id = a.global.uid || a.user.id;
                    a.user.name = a.global.uname || "";
                    a.cache.set("uid", a.user.id);
                    a.isFunction(c) && c();
                    a.base.startTrail(a.base._islogin, !0)
                },
                b)
            },
            startData: function(b, c) {
                var d = this;
                a.Log("nTalk.base.startData()");
                a.require({
                    data: "data.js" + a.baseExt
                },
                function(e) {
                    e ? (e = a.data.start(CON_RULE), d._get_page_data = a.extend({},
                    e, c), d.getPageData(d._get_page_data), b.call(d)) : a.Log("Loaded $data mode failed", 3)
                })
            },
            _execMode: function() {
                this._startBase = !0;
                this._loadFlashServer()
            },
            startTrail: function(b, c) {
                a.require({
                    trail: "trail.js" + a.baseExt
                },
                function(d) {
                    d ? a.trail.start(b, c) : a.Log("Loaded $trail mode failed", 3)
                })
            },
            startIM: function() { (!a.im || !a.im.connect) && a.require({
                    im: "im.js" + a.baseExt
                },
                function(b) {
                    b ? a.im.start() : a.Log("Loaded $im mode failed", 3)
                })
            },
            startLCrm: function(b, c, d) {
                var e = b && a.isArray(b) ? b: [b];
                a.require({
                    lcrm: "lcrm.js" + a.baseExt
                },
                function() {
                    a.each(e,
                    function(b, e) {
                        a.Log("start lcrm mode", 1);
                        a.lcrm.start(e, c, d)
                    })
                })
            },
            startChat: function(b, c, d, e, f, g, i, k) {
                var h, b = b || "",
                c = c || "",
                d = d || "",
                e = e || "",
                f = f || "";
                a.im && a.im.hideTips(); ! 0 === a.base.chatLoading ? a.Log("loading......", 2) : (a.Log("$.base.startChat(" + a.JSON.toJSONString(arguments) + ")", 1), a.base.showLoading(), h = {
                    lang: (a.extParmas.lan || "zh_cn") + ".js" + a.baseExt
                },
                a.global.themes ? (h.chatManage = "chat.js" + a.baseExt, h.chatManageView = a.global.themes + "/chat.view.in.js" + a.baseExt, a.themesURI = a.global.themes + "/images/") : h.chatManage = "chat.in.js" + a.baseExt, h.Window = "nt2.js" + a.baseExt, 1 == a.server.robot && (h.Robot = "robot.js" + a.baseExt), a.require(h,
                function() {
                    a.base.hiddenLoading();
                    a.chatManage ? (a.Log("load $chatManage mode complete"), a.chatManage.open(b, c, d, e, f, g, i, k) && a.cache.set("opd", 1)) : a.Log("Load $chatManage mode failed", 3)
                }))
            },
            startEntrance: function() {
                var b = a.server.entranceConfig[a.global.settingid] || "";
                a.Log("$.base.startEntrance()");
                b && (a.server.entranceConfig && !a.isEmptyObject(a.server.entranceConfig)) && a.require({
                    entrance: b + a.baseExt
                },
                function(b) {
                    b ? ("1" == a.server.enable_entrance && a.options.entrance && a.entrance.start("entrance"), "1" == a.server.enable_entrance && a.options.invite && a.entrance.start("invite")) : a.Log("Load $.entrance mode failed", 3)
                })
            },
            showLoading: function() {
                a.base.chatLoading = !0;
                a.base.startTime = a.getTime(); ! this.loadingElement || !this.loadingElement.length ? this.loadingElement = a({
                    id: "ntalk-chat-loading",
                    style: a.STYLE_NBODY + "width:100%;height:33px;position:fixed:right:0;bottom:0;z-index:9999;"
                }).appendTo(!0).fixed({
                    right: 0,
                    bottom: 0
                }).html('<div style="' + a.STYLE_BODY + "margin:0 auto;width:99px;height:33px;background:url(" + a.imageloading + ') no-repeat 0 0;"></div>') : this.loadingElement.display(1);
                return this.loadingElement
            },
            hiddenLoading: function() {
                this.loadingElement.display();
                a.base.endTime = a.getTime();
                a.base.chatLoading = !1;
                a.Log("$.base.showLoading-hiddenLoading execute time:" + (a.base.endTime - a.base.startTime) + " ms", 1)
            },
            toLongID: function(b) {
                var c = this.checkID(b);
                return c === a.CON_SHORT_ID ? a.global.siteid + "_ISME9754_" + b: c == a.CON_VISITOR_ID ? b: ""
            },
            toShortID: function(b) {
                var c = this.checkID(b);
                return c === a.CON_SHORT_ID ? b: c === a.CON_VISITOR_ID ? b.replace(this.userIdFix, "") : ""
            },
            checkID: function(b) {
                b = b ? b.toString() : "";
                return ! b || "0" === b ? !1 : -1 < b.indexOf("_ISME9754_T2D") ? a.CON_CUSTOMER_ID: -1 < b.indexOf("_ISME9754_GT2D") ? a.CON_GROUP_ID: -1 < b.indexOf(a.global.siteid + "_ISME9754_") ? a.CON_VISITOR_ID: a.CON_SHORT_ID
            },
            startOtherMode: function(b, c) {
                var d = a.cache.get("uid") || "",
                e;
                clearTimeout(this._connectTimeID);
                this._connectTimeID = null;
                this._identityIDReady = !0;
                a.Log("cache uid:" + d + ", site uid:" + b + ", return uid:" + b, 1);
                this._islogin = d ? d != b: !0;
                a.global.pcid = c;
                a.user.id = b;
                a.isDefined(a.global.uname) && (a.user.name = a.global.uname);
                a.cache.set("uid", b);
                a.cookie.set(a.CON_PCID_KEY, c, 63072E6);
                0 === a.server.notrail ? this.startTrail(this._islogin, !1) : a.Log("no load trail");
                a.server.entranceConfig && ("1" == a.server.enable_entrance || "1" == a.server.enable_invite) && this.startEntrance(); ! a.server.isnoim || 3 == a.server.isnoim || 2 == a.server.isnoim && "1" == a.cache.get("opd") ? (a.Log("nTalk.base.startIM()::" + a.im, 1), this.startIM()) : a.Log("no load im, isnoim:" + a.server.isnoim + ", opd:" + a.cache.get("opd"), 1);
                1 == a.browser.mobile && a.addMobileStyle();
                e = {
                    settingid: a.cache.get("carry_sid"),
                    destid: a.cache.get("carry_did")
                };
                0 != a.server.sessioncarry && e.settingid && !a.browser.mobile ? (a.Log("sessioncarry:" + a.JSON.toJSONString(e)), a.cache.set("carry_sid", ""), a.cache.set("carry_did", ""), e.settingid && (a.browser.mobile || !a.global.pageinchat ? (d = {
                    single: -1
                },
                a.im_openOutPageChat(e.settingid, "", e.destid, d, "")) : (d = {
                    autoconnect: !0,
                    single: -1
                },
                a.im_openInPageChat(e.settingid, "", e.destid, d, "")))) : 0 < a.server.preload && !a.global.themes && this.preloadChat()
            },
            preloadChat: function() {
                var b;
                a.Log("$.base.preloadChat()", 1);
                setTimeout(function() { ! 0 !== a.base.chatLoading && (b = {
                        lang: (a.extParmas.lan || "zh_cn") + ".js" + a.baseExt,
                        chatManage: "chat.in.js" + a.baseExt,
                        Window: "nt2.js" + a.baseExt
                    },
                    1 == a.server.robot && (b.Robot = "robot.js" + a.baseExt), a.require(b,
                    function(b, d) {
                        d ? a.Log("preload $chatManage mode complete") : a.Log("preload $chatManage mode failed", 3)
                    }))
                },
                a.server.preload)
            },
            getPageData: function(b) {
                a.Log("nTalk.base.getPageData()");
                b = a.extend({},
                "undefined" !== typeof NTKF_PARAM ? NTKF_PARAM: {},
                b);
                a.whereGetTo(a.global, b, "siteid sellerid settingid uid uname exparams themes isvip userlevel itemid itemparam orderid orderprice erpparam ntalkerparam pagetype title lang iconid".split(" "), [null, null, null, "shortid", "uname", "exparams", "themes"]);
                a.global.siteid = (a.global.siteid + "").replace(/^\s+|\s+$/, "");
                a.global.settingid = (a.global.settingid + "").replace(/^\s+|\s+$/, "");
                a.global.siteid = a.global.siteid && r.test(a.global.siteid) ? a.global.siteid: a.extParmas.siteid || "";
                if ("" == a.global.siteid) return ! 1;
                a.global.pagetype = a.params.source || "";
                a.global.sellerid = a.isArray(a.global.sellerid) ? a.global.sellerid: -1 < a.global.sellerid.toString().indexOf(",") ? a.global.sellerid.split(",") : a.global.sellerid ? [a.global.sellerid] : [];
                a.global.orderid = a.isArray(a.global.orderid) ? a.global.orderid: -1 < a.global.orderid.toString().indexOf(",") ? a.global.orderid.split(",") : a.global.orderid ? [a.global.orderid] : [];
                a.global.orderprice = a.isArray(a.global.orderprice) ? a.global.orderprice: -1 < a.global.orderprice.toString().indexOf(",") ? a.global.orderprice.split(",") : a.global.orderprice ? [a.global.orderprice] : []; - 1 < a.inArray(a.global.siteid, p) && (a.global.shortid = a.global.uname || ""); ! a.global.itemid && a.global.ntalkerparam && (a.isObject(a.global.ntalkerparam) || a.Log("ntalkerparam param abnormal", 2), a.global.ntalkerparam.item && (a.global.itemid = a.global.ntalkerparam.item.id));
                if (!/number|string/i.test(typeof a.global.shortid) || !/string/i.test(typeof a.global.uname)) a.global.shortid = "",
                a.global.uname = "";
                a.referrer = a.enCut(a.referrer, 255);
                a.global.settingid = a.global.settingid && /[a-z]{2}\_\d+\_\d+/ig.test(a.global.settingid) ? a.global.settingid: "";
                a.global.iconid = a.isNumeric(a.global.iconid) ? a.global.iconid: 0;
                a.global.title = a.enCut(a.title, 255);
                a.global.shortid = !a.global.shortid || "0" == a.global.shortid ? "": a.enCut(a.global.shortid, 64 - a.enLength(a.global.siteid) - 10);
                a.global.uname = !a.global.shortid || "0" == a.global.shortid ? "": a.global.uname ? a.enCut(a.global.uname, 32) : a.enCut(a.global.shortid, 32);
                a.global.uid = this.toLongID(a.global.shortid);
                a.global.isvip = a.isNumeric(a.global.isvip) ? a.global.isvip: a.isNumeric(a.global.userlevel) ? a.global.userlevel: 0;
                a.global.userlevel = a.isNumeric(a.global.userlevel) ? a.global.userlevel: 0;
                a.global = this.filterJSONChar(a.global, "");
                a.Log("global: " + a.JSON.toJSONString(a.global), 1);
                return a.global
            },
            _filterChar: function(b, c) {
                var d = [],
                e,
                f;
                c && a.each(this.entityList,
                function(a, c) {
                    try {
                        e = RegExp(a, "gi"),
                        b = b.replace(e, c)
                    } catch(d) {}
                });
                for (var g = 0,
                i = b.length; g < i; g++) try {
                    f = encodeURIComponent(b.charAt(g)),
                    d.push(b.charAt(g))
                } catch(k) {
                    try {
                        f = encodeURIComponent(b.charAt(g) + b.charAt(g + 1)),
                        d.push((!d.length ? "": " ") + f.replace(/%/gi, "") + (g + 2 >= i ? "": " ")),
                        ++g
                    } catch(h) {
                        d.push(b.charAt(g))
                    }
                }
                return d.join("")
            },
            filterJSONChar: function(b, c) {
                var d, e = this;
                if (a.isObject(b)) d = {},
                a.each(b,
                function(a, b) {
                    d[a] = e.filterJSONChar(b, a)
                });
                else if (a.isArray(b)) {
                    d = [];
                    for (var f = 0; f < b.length; f++) d[f] = this.filterJSONChar(b[f], f)
                } else d = "string" == typeof b ? this._filterChar(b, -1 !== a.inArray(c, this.fieldList)) : b;
                return d
            },
            _loadIdentityID: function(b) {
                var c = this,
                d, e, f = "";
                "undefined" !== typeof ntalker && ntalker.getIdentityID && (a.Log("get sdk pcid"), f = ntalker.getIdentityID());
                a.Log("ntalker type : " + typeof ntalker);
                "" == f && (f = a.cookie.get(a.CON_PCID_KEY));
                a.global.trailid = a.cache.get("tid");
                this.userIdFix = a.global.siteid + "_ISME9754_";
                a.global.trailid && (e = Math.round((a.getTime() - +a.global.trailid.toString().substr(0, 13)) / 36E5), 4 <= e && (a.global.trailid = ""));
                if (!a.global.trailid || -1 < a.url.indexOf("livecrmtest")) a.global.trailid = a.getTime(2),
                a.base.clearChatCache = !0,
                a.flashData && a.flashData.clearAll();
                f && 10 < f.length ? (d = a.global.uid && -1 < a.global.uid.indexOf(a.global.siteid) ? a.global.uid: this.userIdFix + f.substr(0, 21), a.Log("load PCID:" + f + ", uid:" + d), b.call(this, d, f)) : a.flash.support && !a.browser.mobile ? (this._createNTID({
                    u: a.global.uid,
                    siteid: a.global.siteid,
                    loadnid: a.CON_LOAD_MODE_NID
                }), f = this._createScriptPCID(!0), a.Log("create flash PCID, tmp pcid:" + f), d = a.global.uid || this.userIdFix + f.substr(0, 21), a.global.pcid = f, a.user.id = d, this._connectTimeID = setTimeout(function() {
                    a.global.connect = a.CON_CONNECT_COMET;
                    a.Log("timeout:" + c.timeOut + " no create pcid", 2);
                    b.call(c, d, f)
                },
                this.timeOut)) : a.cookie.enable() ? (f = this._createScriptPCID(!1), a.Log("create script PCID"), d = a.global.uid || this.userIdFix + f.substr(0, 21), b.call(this, d, f)) : (c = this, a.require({
                    Fingerprint2: "fingerprint2.js" + a.baseExt
                },
                function() {
                    a.Fingerprint2 ? (fingerprint2 = new a.Fingerprint2, fingerprint2.get(function(e) {
                        f = "guest-Fin" + e;
                        d = a.global.uid || c.userIdFix + f.substr(20, 41);
                        b(d, f)
                    })) : a.Log("load Fingerprint2 failure")
                }))
            },
            _createNTID: function(b) {
                var c = a("#nt-flash-div"),
                b = a.flashHtml("ntkf_flash_ntid", a.sourceURI + "fs/NTID.swf?" + a.version.ntid, b);
                c.length || (c = a(document.body).insert('<div id="nt-flash-div" style="position: absolute; z-index: 9996; top: -200px;"></div>'));
                c.insert(b)
            },
            _createScriptPCID: function(b) {
                return "guest" + [b ? "TEMP" + a.randomChar(4) : a.randomChar(8), a.randomChar(4), a.randomChar(4), a.randomChar(4), a.getTime().toString(16).toUpperCase().substr( - 8) + a.randomChar(4)].join("-")
            },
            _loadFlashServer: function() {
                a.Log("start load flashserver.");
                a.require({
                    flashserver: a.server.flashserver + "/func/getflashserver.php?" + a.toURI({
                        resulttype: 1,
                        siteid: a.global.siteid,
                        callbackname: "nTalk._callFlashServer"
                    }) + "#rnd"
                },
                function(b) {
                    b = a.extend({},
                    q, b);
                    a.server = a.protocolFilter(a.extend(a.server, b))
                })
            }
        };
        a.extend({
            _callFlashServer: function(b, c) {
                a.flashserver = b;
                a.server = a.protocolFilter(a.extend(a.server, a.flashserver));
                a.Log("$flashserver loading is complete. resultType:" + c)
            },
            fIM_presenceFlashReady: function(b, c) {
                setTimeout(function() {
                    a.base._identityIDReady ? (a.Log("$.fIM_presenceFlashReady()"), a.Event.fireEvent(document, "focus") || a.Event.fireEvent(document, "click"), a.im && a.im.connect && a.im.connect.stopSwitchConnect()) : (a.Log(">RETURN flash PCID, uid:" + b + ", pcid:" + c, 1), b && c && a.base.startOtherMode(b, c))
                },
                0);
                return ! 0
            },
            isJsReady: function() {
                return ! 0
            },
            _createMobileIframeWindow: function(b) {
                var c = a(".ntalk-mobile-iframe-window"),
                d = a("IFRAME[name=" + b + "]");
                if (c.length) return {
                    created: !1,
                    element: c
                };
                c = a({
                    className: "ntalk-mobile-iframe-window",
                    "data-status": "visible",
                    style: a.STYLE_BODY + "background:#fff;width:100% !important;height:100% !important;position:fixed;left:0;top:0px;-webkit-overflow-scrolling: touch;overflow-y:scroll"
                }).appendTo(!0);
                d = a({
                    tag: "IFRAME",
                    name: b,
                    style: a.STYLE_BODY + "width:100% !important;height:100% !important;display:block !important;",
                    src: "about:blank"
                }).appendTo(".ntalk-mobile-iframe-window");
                a(window).bind("resize",
                function() {
                    a(d).css({
                        width: "100%",
                        height: a(window).height() + "px"
                    });
                    "hidden" == c.attr("data-status") ? c.css("top", a(window).height() + "px") : c.css("top", "0px")
                });
                a.listenerMessage(function(b) {
                    a.Log("listenerMessage:" + b);
                    switch (b) {
                    case "hideMobileIframeWindow":
                        a._hideMobileIframeWindow(c, !1);
                        break;
                    case "closeMobileIframeWindow":
                        a._hideMobileIframeWindow(c, !0)
                    }
                });
                return {
                    created: !0,
                    element: c
                }
            },
            _showMobileIframeWindow: function(b) {
                nTalk.isObject(b) && b.talkVersion && (a("html").addClass("full-html"), a("body").addClass("full-body"), b.addClass("full-iframe"), b.css("z-index", "999999999"))
            },
            _hideMobileIframeWindow: function(b, c) {
                if (!nTalk.isObject(b) || !b.talkVersion) return b;
                a("html").removeClass("full-html");
                a("body").removeClass("full-body");
                b.removeClass("full-iframe");
                b.css({
                    "z-index": -1,
                    display: "none"
                });
                c && b.remove()
            },
            addMobileStyle: function() {
                var a = document.head || document.getElementsByTagName("head")[0],
                c = document.createElement("style");
                c.type = "text/css";
                c.styleSheet ? c.styleSheet.cssText = ".full-html,.full-body{width: 100% !important;height: 100% !important;margin: 0 !important;overflow: hidden !important;}.full-body *{display: none !important;}.full-iframe {display: block !important;}": c.appendChild(document.createTextNode(".full-html,.full-body{width: 100% !important;height: 100% !important;margin: 0 !important;overflow: hidden !important;}.full-body *{display: none !important;}.full-iframe {display: block !important;}"));
                a.appendChild(c)
            }
        });
        a.extend({
            im_openInPageChat: function(b, c, d, e, f) {
                var g, i, k, h;
                if (a.base._startBase) if (a.base.chanageUserID()) a.base.overloadedData(function() {
                    a.im_openInPageChat(b, c, d, e, f)
                });
                else {
                    a.invite && a.invite._close();
                    a.Log("nTalk.im_openInPageChat()", 1);
                    b = b || a.global.settingid || "";
                    g = a.global.settingid ? a.global.settingid.split("_").splice(0, 2).join("_") : "";
                    i = b ? b.split("_").splice(0, 2).join("_") : "";
                    h = a.global.sellerid && a.global.sellerid.length ? a.global.sellerid[0] : "";
                    e = a.extend({},
                    e);
                    c || (!i || "" != i && (i == h || i == g) ? (c = a.global.itemid, f = a.global.itemparam) : f = c = "");
                    h = i != a.global.siteid ? i: "";
                    a.Log("settingId:" + b + ", itemId:" + c + ", itemparam:" + f);
                    if (a.browser.mobile || !0 !== a.global.pageinchat) return this.im_openOutPageChat(b, c, d, e, f);
                    2 == a.server.notrail && !a.base.call_trail_status && (a.base.call_trail_status = !0, a.base.startTrail());
                    g = e && e.single ? e.single: "";
                    i = e && e.manual ? 1 : 0;
                    var j = e && a.isDefined(e.autoconnect) ? e.autoconnect: !1;
                    this.base.startChat(b, d, c, f, h, j, g, i)
                } else a.base.start(),
                function() {
                    k = arguments;
                    a.base._startBase ? a.im_openInPageChat(b, c, d, e, f) : setTimeout(function() {
                        k.callee()
                    },
                    50)
                } ()
            },
            im_openOutPageChat: function(b, c, d, e, f) {
                var g, i, k, h;
                if (a.base._startBase) if (a.base.chanageUserID()) a.base.overloadedData(function() {
                    a.im_openInPageChat(b, c, d, e, f)
                });
                else {
                    a.Log("nTalk.im_openOutPageChat()", 1);
                    b = b || a.global.settingid || "";
                    g = a.global.settingid ? a.global.settingid.split("_").splice(0, 2).join("_") : "";
                    i = b ? b.split("_").splice(0, 2).join("_") : "";
                    h = a.global.sellerid && a.global.sellerid.length ? a.global.sellerid[0] : "";
                    e = a.extend({},
                    e);
                    c || (!i || "" != i && (i == h || i == g) ? (c = a.global.itemid, f = a.global.itemparam) : f = c = "");
                    h = i != a.global.siteid ? i: "";
                    a.Log("settingId:" + b + ", itemId:" + c + ", itemparam:" + f);
                    var j, l = a.browser.mobile ? "_self": "_blank";
                    g = e && e.single ? e.single: "";
                    var m = {
                        v: a.version.script,
                        siteid: a.global.siteid,
                        sellerid: h,
                        settingid: b,
                        baseuri: a.baseURI,
                        mobile: a.browser.mobile ? 1 : 0,
                        lan: a.extParmas.lan || "",
                        iframechat: e.iframechat || "0",
                        header: a.isDefined(e.header) ? e.header: "1",
                        rnd: a.getTime()
                    },
                    n = {
                        uid: a.user.id,
                        uname: a.user.name,
                        pcid: a.global.pcid,
                        vip: a.global.isvip,
                        ulevel: a.global.userlevel,
                        destid: d || "",
                        single: g ? g: !d ? -1 : -1 < d.indexOf("GT2D") ? 0 : 1,
                        chattype: "",
                        chatvalue: "",
                        itemid: c,
                        itemparam: f,
                        erpparam: a.global.erpparam,
                        ref: a.enCut(a.url, 255),
                        tit: a.global.title,
                        "ntalker-debug": a.params["ntalker-debug"] || a.cache.get("debug"),
                        exparams: a.global.exparams
                    };
                    if ("undefined" !== typeof ntalker && ntalker.openChatWindow) {
                        sdkQuery = a.extend({},
                        m, n);
                        sdkQuery.uid = a.base.toShortID(sdkQuery.uid);
                        sdkQuery.flashserver = a.server.flashserver;
                        a.Log("call ntalker.openChatWindow()", 2);
                        h = ntalker.openChatWindow(a.JSON.toJSONString(sdkQuery));
                        a.Log("call ntalker.openChatWindow()>>" + h, 3);
                        if (0 === h) return;
                        a.Log("call ntalker.openChatWindow()>>" + h, 3)
                    }
                    a.global.themes && (m.themes = a.global.themes);
                    if (e.iframechat) return l = "ntalk-mobile-chat",
                    a.require({
                        animate: "nt2.js" + a.baseExt
                    },
                    function() {
                        if (a.animate) {
                            j = a._createMobileIframeWindow(l);
                            if (!j || j && !0 === j.created) a.objectPost = new a.POST(a.server.flashserver + "chat.php?" + a.toURI(m, !0, "&"), n,
                            function() {
                                a.Log("open chat window complete", 1)
                            },
                            l);
                            a._showMobileIframeWindow(j.element)
                        } else a.Log("Loaded $nt2 mode failed", 3)
                    }),
                    null;
                    if (!j || j && !0 === j.created) a.objectPost = new a.POST(a.server.flashserver + "chat.php?" + a.toURI(m, !0, "&"), n,
                    function() {
                        a.Log("open chat window complete", 1)
                    },
                    l);
                    return j ? j.element: a.objectPost.iframeElement
                } else a.base.start(),
                function() {
                    k = arguments;
                    a.base._startBase ? a.im_openInPageChat(b, c, d, e, f) : setTimeout(function() {
                        k.callee()
                    },
                    50)
                } ()
            },
            im_getAppChatWindowURL: function(b, c) {
                var d, e, f, g, i, k, h, j;
                a.base._startBase ? a.base.chanageUserID() ? a.base.overloadedData(function() {
                    a.im_getAppChatWindowURL(b, c)
                }) : (a.Log("nTalk.im_getAppChatWindowURL()", 1), "function" == typeof b ? (c = b, b = {}) : b = a.extend({},
                b), i = b.destid || "", k = b.settingId || a.global.settingid || "", d = a.global.settingid ? a.global.settingid.split("_").splice(0, 2).join("_") : "", e = b.settingid ? b.settingid.split("_").splice(0, 2).join("_") : "", g = a.global.sellerid && a.global.sellerid.length ? a.global.sellerid[0] : "", j = a.extend({},
                b.options), b.itemid ? (d = b.itemid, h = b.itemparam) : !e || "" != e && (e == g || e == d) ? (d = a.global.itemid, h = a.global.itemparam) : h = d = "", g = e != a.global.siteid ? e: "", a.Log("settingId:" + k + ", itemId:" + d + ", itemparam:" + h), e = j && j.single ? j.single: "", g = {
                    v: a.version.script,
                    siteid: a.global.siteid,
                    sellerid: g,
                    settingid: k,
                    baseuri: a.baseURI,
                    mobile: a.browser.mobile ? 1 : 0,
                    lan: a.extParmas.lan || "",
                    header: a.isDefined(j.header) ? j.header: "1",
                    uid: a.user.id,
                    uname: a.user.name,
                    pcid: a.global.pcid,
                    vip: a.global.isvip,
                    ulevel: a.global.userlevel,
                    destid: i || "",
                    single: e ? e: !i ? -1 : -1 < i.indexOf("GT2D") ? 0 : 1,
                    chattype: "",
                    chatvalue: "",
                    itemid: d,
                    itemparam: h,
                    erpparam: a.global.erpparam,
                    ref: a.enCut(a.url, 255),
                    tit: a.global.title,
                    "ntalker-debug": a.params["ntalker-debug"] || a.cache.get("debug") || "",
                    exparams: a.global.exparams
                },
                a.isFunction(c) && c.call(self, a.server.flashserver + "recieve.php?" + a.toURI(g, !0, "&"))) : (a.base.start(),
                function() {
                    f = arguments;
                    a.base._startBase ? a.im_getAppChatWindowURL(b, c) : setTimeout(function() {
                        f.callee()
                    },
                    50)
                } ())
            },
            im_updatePageInfo: function(b) {
                a.base.overloadedData(b)
            },
            im_addTrailInfo: function(b, c, d) {
                a.referrer = a.url;
                a.title = b || document.title;
                a.url = c || document.location.href;
                a.base.overloadedData(d)
            },
            t2d: {
                openChatWindow: function(b, c, d) {
                    a.im_openOutPageChat(d, "", b, null, "")
                }
            },
            enableDebug: function() {
                a.cache.get("debug") || a.cache.set("debug", 2);
                a.mDebug || a.require({
                    mDebug: "debug.js" + a.baseExt,
                    Window: "nt2.js" + a.baseExt
                },
                function(b) {
                    b && !b.error && (a.mDebug.initialize(), a.Log = a.mDebug.Log, a.debug = a.mDebug)
                });
                return a.cache.get("debug")
            }
        });
        if (!a.isDefined(CON_SERVER)) throw "CON_SERVER is not defined";
        a.imageloading = a.sourceURI + "images/loading.gif";
        a.server = a.extend({},
        a.protocolFilter(CON_SERVER));
        a.version = a.extend({},
        a.version, CON_VERSION);
        a.baseExt = "?siteid=" + (a.extParmas.siteid || "") + "&v=" + a.version.dir + "&t=" + a.version.release;
        0 < parseFloat(a.params["ntalker-debug"]) || 0 < +a.cache.get("debug") ? a.require({
            mDebug: "debug.js" + a.baseExt,
            Window: "nt2.js" + a.baseExt
        },
        function(b) {
            b && !b.error && (a.mDebug.initialize(), a.Log = a.mDebug.Log, a.debug = a.mDebug, a.base.start())
        }) : (a.Log = new Function, a.debug = {
            Log: a.Log
        },
        a.base.start());
        a.require(a.imageloading)
    }
})(nTalk);

/* @file nt2.js
 * @date 2016.04.28 03:23:04 
 */
(function(a, r) {
    if (a.animate) a.Log("nt2.js loaded");
    else {
        var q;
        q = document.documentElement.style;
        if (q.webkitTransition !== r || q.MozTransition !== r || q.OTransition !== r || q.msTransition !== r || q.transition !== r) {
            q = document.documentElement.style;
            var w = (q.webkitTransition !== r ? "Webkit": q.MozTransition !== r ? "Moz": q.OTransition !== r ? "O": q.msTransition !== r ? "ms": "") + "Transition";
            q = function(b, c, d, e) {
                var f = [],
                g = [],
                k = [],
                j = [],
                l = b.style,
                d = d || 300;
                a.each(c,
                function(c, d) {
                    g[c] = a.camelize(c);
                    a.isObject(d) ? (d.to = d.to || 0, f[c] = !a.cssNumber[c] ? parseInt(d.to, 10) : d.to, k[c] = a.unit(c, d.to), a.isDefined(d.from) && a.css(b, g[c], parseInt(d.from, 10) + k[c])) : (f[c] = a.cssNumber[c] ? parseInt(d, 10) : d, k[c] = a.unit(c, d), a.css(b, g[c], f[c]));
                    j.push(c)
                });
                setTimeout(function() {
                    l[w] = "all " + d + "ms";
                    a.each(j,
                    function(b, c) {
                        l[g[c]] = f[c] + k[c]
                    })
                },
                15);
                setTimeout(function() {
                    l[w] = "";
                    e && e.call(b)
                },
                d);
                return b
            }
        } else q = function(b, c, d, e) {
            var f = 0,
            g = 0,
            k = 0,
            j = [],
            l = [],
            h = [],
            p = [],
            q = [],
            m,
            d = d || 300;
            a.each(c,
            function(c, d) {
                h.push(a.camelize(c));
                a.isObject(d) ? (m = d.to, a.isDefined(d.from) ? l.push(!a.cssNumber[c] ? parseInt(d.from, 10) : d.from) : l.push(!a.cssNumber[c] ? parseInt(a(b).css(c), 10) : a(b).css(c)), a.css(b, h[g], l[g] + a.unit(c, m))) : (m = d, l.push(a(b).css(c)));
                j.push(a.cssNumber[c] ? m: isNaN(parseInt(m, 10)) ? "": parseInt(m, 10));
                p.push(a.unit(c, m));
                g++;
                k++
            });
            for (c = 0; 30 > c; c++) {
                q[c] = [];
                for (g = 0; g < k; g++) q[c][h[g]] = !a.cssNumber[h[g]] && !a.isNumeric(parseInt(l[g])) ? "": l[g] + (j[g] - l[g]) / 30 * c + ("opacity" === h[g] ? "": p[g])
            }
            for (; 30 > g; g++) setTimeout(function() {
                for (g = 0; g < k; g++) a.css(b, h[g], q[f][h[g]]);
                f++
            },
            d / 30 * g);
            setTimeout(function() {
                for (g = 0; g < k; g++) a.css(b, h[g], j[g] + p[g]);
                e && e.call(b)
            },
            d);
            return b
        };
        a.animate = q;
        a.extend({
            listenerFunctions: [],
            listenerMessage: function(b) {
                function c(b) {
                    a.each(a.listenerFunctions,
                    function(c, f) {
                        f.apply(a, [b.data])
                    })
                }
                a.listenerFunctions.push(b);
                window.addEventListener && !0 !== this.__listenerMessage && (window.addEventListener("message", c), this.__listenerMessage = !0)
            },
            postMessage: function(b, c, a) {
                if (b.postMessage) try {
                    b.postMessage(c, a || "*")
                } catch(e) {}
            }
        });
        a.Window = a.Class.create();
        a.Window.prototype = {
            defaultOptions: {
                dropHeight: 30,
                width: 520,
                height: 410,
                left: 100,
                top: 100,
                minWidth: 520,
                minHeight: 410,
                resize: !1,
                drag: !1,
                fixed: !1,
                zIndex: 1E6,
                rightNode: !0,
                onChanage: new Function,
                onClose: new Function,
                onMinimize: new Function,
                onMaximize: new Function,
                onMaxResize: new Function
            },
            _tmpMove: null,
            _tmpStop: null,
            containter: null,
            header: null,
            body: null,
            chatBody: null,
            rightElement: null,
            buttonResize: null,
            buttonClose: null,
            buttonMax: null,
            buttonMin: null,
            _x: 0,
            _y: 0,
            _isdrag: null,
            _Style: null,
            parent: null,
            initialize: function(b, c) {
                a.extend(this, this.defaultOptions, b);
                this.parent = c || null;
                this.quirks = a.browser.msie6 || a.browser.Quirks && a.browser.oldmsie;
                this.right = a(window).width() - this.left - this.width;
                this.bottom = a(window).height() - this.top - this.height;
                a.Log("$.Window:: left:" + this.left + ", top:" + this.top);
                this._create();
                this._bind()
            },
            close: function(b) {
                this.cancelBubble(b);
                if ( - 1 >= this.onClose.toString().indexOf("anonymous")) this.onClose();
                else this.containter.hide(function() {
                    a(this).remove()
                })
            },
            change: function(b) {
                b && this.onChanage.call(this, {
                    width: this.width,
                    height: this.height
                });
                this._isdrag || (this.chatBody.css({
                    height: this.height - this.dropHeight + "px"
                }), this.rightNode && this.rightElement.css("height", this.height - this.dropHeight + "px"))
            },
            maxresize: function() {
                this.onMaxResize()
            },
            minimize: function(b, c) { ! 0 !== c && this.cancelBubble(b);
                this.containter.css({
                    height: "0px",
                    width: "0px"
                });
                if (!0 !== c) this.onMinimize()
            },
            maximize: function(b, c) {
                this.containter.css({
                    height: this.height + "px",
                    width: this.width + "px"
                });
                if (!0 !== c) this.onMaximize()
            },
            cancelBubble: function(b) {
                this.containter.css("z-index", this.zIndex);
                a.Event.fixEvent(b).stopPropagation()
            },
            changeAttr: function(b, c) {
                this.quirks && this.clearExpression();
                a.extend(this, {
                    width: b,
                    height: c,
                    left: Math.max(0, a(window).width() - this.right - b),
                    top: Math.max(0, a(window).height() - this.bottom - c)
                });
                this.containter.css({
                    width: this.width + "px",
                    height: this.height + "px",
                    left: this.left + "px",
                    top: this.top + "px"
                });
                this.quirks && this.fixedPosition();
                this.change(!0)
            },
            start: function(b, c) {
                c || this.cancelBubble(b);
                this._Style = c ? {
                    x: "left",
                    y: "top"
                }: {
                    x: "width",
                    y: "height"
                };
                this.right = a(window).width() - this.left - this.width;
                this.bottom = a(window).height() - this.top - this.height;
                this.quirks && !c && this.clearExpression();
                b = a.Event.fixEvent(b);
                this.containter.css({
                    "z-index": ++this.zIndex
                });
                this._x = (this._isdrag = c) ? b.clientX - this.containter.get(0).offsetLeft || 0 : this.containter.get(0).offsetLeft || 0;
                this._y = c ? b.clientY - this.containter.get(0).offsetTop || 0 : this.containter.get(0).offsetTop || 0;
                a.browser.msie ? this.containter.bind("losecapture", this._tmpStop).get(0).setCapture() : (a.Event.fixEvent(b).preventDefault(), a(window).bind("blur", this._tmpStop));
                a(document).bind("mousemove", this._tmpMove);
                a(document).bind("mouseup", this._tmpStop)
            },
            move: function(b) {
                window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
                var b = a.Event.fixEvent(b),
                c = b.clientX - this._x,
                b = b.clientY - this._y,
                d = a(window).offset();
                this._isdrag ? (this.quirks ? (this[this._Style.x] = Math.min(Math.max(c, d.left), d.left + a(window).width() - this.width) - d.left, this[this._Style.y] = Math.min(Math.max(b, d.top), d.top + a(window).height() - this.height) - d.top) : (this[this._Style.x] = Math.min(Math.max(c, 0), a(window).width() - this.width), this[this._Style.y] = Math.min(Math.max(b, 0), a(window).height() - this.height)), this.containter.css(this._Style.x, (this.quirks ? d.left: 0) + Math.max(0, this[this._Style.x]) + "px"), this.containter.css(this._Style.y, (this.quirks ? d.top: 0) + Math.max(0, this[this._Style.y]) + "px")) : (this.quirks ? (this[this._Style.x] = Math.min(Math.max(c + (this.quirks ? d.left: 0), this.minWidth), a(window).width() - this.left), this[this._Style.y] = Math.min(Math.max(b + (this.quirks ? d.top: 0), this.minHeight), a(window).height() - this.top)) : (this[this._Style.x] = Math.min(Math.max(c, this.minWidth), a(window).width() - this.left), this[this._Style.y] = Math.min(Math.max(b, this.minHeight), a(window).height() - this.top)), this.containter.css(this._Style.x, this[this._Style.x] + "px"), this.containter.css(this._Style.y, this[this._Style.y] + "px"));
                this.right = a(window).width() - this.left - this.width;
                this.bottom = a(window).height() - this.top - this.height;
                this.change(!0)
            },
            stop: function() {
                this.quirks && this.fixedPosition();
                this.containter.css({
                    "z-index": --this.zIndex
                });
                a(document).removeEvent("mousemove", this._tmpMove);
                a(document).removeEvent("mouseup", this._tmpStop);
                a.browser.msie ? this.containter.removeEvent("losecapture", this._tmpStop).get(0).releaseCapture() : a(window).removeEvent("blur", this._tmpStop)
            },
            fixedPosition: function() {
                if (this.quirks) {
                    var b = a(window).scrollTop();
                    a(window).scrollTop(b + 1);
                    this.containter.replaceIEcssText({
                        left: "expression(eval(Math.max((document.documentElement.scrollLeft || document.body.scrollLeft), (document.documentElement.scrollLeft || document.body.scrollLeft) + (document.documentElement.clientWidth  || document.body.clientWidth ) - this.offsetWidth  - " + this.right + ")))",
                        top: "expression(eval(Math.max((document.documentElement.scrollTop  || document.body.scrollTop ), (document.documentElement.scrollTop  || document.body.scrollTop ) + (document.documentElement.clientHeight || document.body.clientHeight) - this.offsetHeight - " + this.bottom + ")))"
                    });
                    a(window).scrollTop(b);
                    a(window).scrollLeft(1)
                } else this.containter.css({
                    left: this.left + "px",
                    top: this.top + "px"
                })
            },
            clearExpression: function() {
                var b = a(window).offset();
                this.containter.Expression("left", "");
                this.containter.Expression("top", "");
                this.containter.Expression("left", "");
                this.containter.replaceIEcssText({
                    left: b.left + this.left + "px",
                    top: b.top + this.top + "px"
                })
            },
            _for_resize: function() {
                this.left = Math.max(0, a(window).width() - this.right - this.width);
                this.top = Math.max(0, a(window).height() - this.bottom - this.height);
                this.quirks || this.containter.css({
                    left: this.left + "px",
                    top: this.top + "px"
                })
            },
            _create: function() {
                this.containter = a({
                    className: this.className || "ntalk-window-containter",
                    style: a.STYLE_BODY + "box-sizing:content-box;overflow:hidden;"
                }).appendTo(this.parent, !0).css({
                    position: !this.fixed ? "absolute": !this.quirks ? "fixed": "absolute",
                    border: "none",
                    width: this.width + "px",
                    height: this.height + "px",
                    zIndex: this.zIndex
                });
                this.fixedPosition();
                this.header = a({
                    className: "ntalk-window-head",
                    style: a.STYLE_BODY + "cursor:move;position:relative;left:0;top:0;"
                }).appendTo(this.containter).css({
                    width: "100%",
                    height: this.dropHeight + "px"
                });
                this.buttonClose = a({
                    className: "ntalk-button-close",
                    style: a.STYLE_BODY + "width:20px;height:20px;cursor:pointer;position:static;float:right;position:relative;margin:2px 3px 0 0;line-height:20px;vertical-align:middle;background:none;"
                }).appendTo(this.header);
                this.buttonMax = a({
                    className: "ntalk-button-maxresize",
                    style: a.STYLE_BODY + "width:20px;height:20px;cursor:pointer;position:static;float:right;position:relative;margin:2px 3px 0 0;line-height:20px;vertical-align:middle;background:none;"
                }).appendTo(this.header);
                this.buttonMin = a({
                    className: "ntalk-button-min",
                    style: a.STYLE_BODY + "width:20px;height:20px;cursor:pointer;position:static;float:right;position:relative;margin:2px 3px 0 0;line-height:20px;vertical-align:middle;background:none;"
                }).appendTo(this.header);
                this.body = a({
                    className: "ntalk-window-body",
                    style: a.STYLE_BODY + "float:left;width:100%;"
                }).appendTo(this.containter);
                this.chatBody = a({
                    className: "ntalk-chat-body",
                    style: a.STYLE_BODY + "width:100%;position:relative;left:0;top:0;"
                }).appendTo(this.body);
                this.rightNode && (this.rightElement = a({
                    className: "ntalk-window-right",
                    style: a.STYLE_BODY + "float:left;display:none;width:100%;"
                }).appendTo(this.containter));
                this.resize && (this.buttonResize = a({
                    className: "window-resize",
                    style: a.STYLE_BODY + "width:10px;height:10px;cursor:nw-resize;position:absolute;right:1px;bottom:1px;font-size:0;background:none;z-index:99;"
                }).appendTo(this.containter));
                a({
                    style: a.STYLE_BODY + "clear:both;"
                }).appendTo(this.containter);
                this.change();
                return this.containter
            },
            _bind: function() {
                var b = this;
                this.containter.bind("mousedown",
                function(c) {
                    b.drag && b.start.call(b, c, !0)
                });
                this.buttonClose.bind("mousedown",
                function(c) {
                    a.Event.fixEvent(c).stopPropagation();
                    b.close.call(b, c)
                });
                this.buttonMax.bind("mousedown",
                function(c) {
                    a.Event.fixEvent(c).stopPropagation();
                    b.maxresize.call(b, c)
                });
                this.buttonMin.bind("mousedown",
                function(c) {
                    a.Event.fixEvent(c).stopPropagation();
                    b.minimize.call(b, c)
                });
                this.chatBody.bind("mousedown",
                function(c) {
                    b.cancelBubble.call(b, c)
                });
                this.rightNode && this.rightElement.bind("mousedown",
                function(c) {
                    b.cancelBubble.call(b, c)
                });
                this.resize && this.buttonResize.bind("mousedown",
                function(c) {
                    b.start.call(b, c, !1)
                });
                this.fixed && a(window).bind("resize",
                function() {
                    b._for_resize()
                });
                this._tmpStop = function(c) {
                    b.stop.call(b, c)
                };
                this._tmpMove = function(c) {
                    b.move.call(b, c)
                }
            }
        };
        a.Queue = a.Class.create();
        a.Queue.prototype = {
            list: null,
            length: 0,
            initialize: function() {
                this.list = [];
                this.length = this.list.length
            },
            isEmpty: function() {
                return 0 === this.list.length
            },
            enQueue: function(b) {
                this.list.push(b);
                this.length = this.list.length;
                return this.list[this.length - 1]
            },
            deQueue: function() {
                var b;
                if (this.isEmpty()) return null;
                b = this.list.shift();
                this.length = this.list.length;
                return b
            },
            queueFront: function() {
                return this.isEmpty() ? null: this.list[0]
            }
        };
        a.pageManage = a.Class.create();
        a.pageManage.prototype = {
            identid: "",
            keyid: "",
            data: null,
            interID: null,
            options: null,
            debug: !1,
            inter: 0.8,
            count: 0,
            chanageCall: !0,
            CON_MANAGE_PAGE_LIST: "IM_EXIST_PAGEARR",
            pageStore: null,
            initialize: function(b, c) {
                var d = this,
                e, f, g = 3;
                this.debug && a.Log("pageManage.initialize():");
                this.options = a.extend(this.options, {
                    onChanage: new Function,
                    onInterval: new Function,
                    pageNum: 3,
                    timeout: 2.5,
                    inter: 0.8
                },
                b);
                this.keyid = a.CON_MANAGE_COOKIE + (c ? "_" + c.toUpperCase() : "");
                this.identid = this._2shortTime(0, 8, 13);
                a.browser.chrome && (this.options.timeout = 5);
                this.options.timeout *= 10;
                this.options.inter *= 1E3;
                this.inter = this.options.inter;
                this.pageStore = a.store;
                try {
                    for (; g--&&!(e = this.pageStore.get(this.CON_MANAGE_PAGE_LIST) || "", "" != e););
                    f = this._get().m;
                    e = "" == e || 0 == f.length ? [] : e.split(",");
                    if (e.length != f.length && e.length <= this.options.pageNum) {
                        e = [];
                        for (g = 0; g < f.length; g++) for (var k in f[g]) e.push(k)
                    }
                    e.push(this.identid);
                    this.pageStore.set(this.CON_MANAGE_PAGE_LIST, e.join(","))
                } catch(j) {}
                var l = a.getTime();
                this.interID = setInterval(function() {
                    setTimeout(function() {
                        now = a.getTime();
                        d._update(now - l);
                        d.options.onInterval(d.options.timeout, d.data.m);
                        l = a.getTime()
                    },
                    0)
                },
                this.options.inter);
                a.Event.addEvent(window, "unload",
                function() {
                    d._remove();
                    setTimeout(function() {},
                    500)
                })
            },
            getIsLastPage: function() {
                return this.data.m.length
            },
            _get: function() {
                var b = a.cookie.get(this.keyid) || "{}";
                return a.extend({
                    m: []
                },
                a.JSON.parseJSON(b))
            },
            _save: function() {
                var b = a.JSON.toJSONString(this.data);
                a.cookie.set(this.keyid, b, 0);
                return b
            },
            _remove: function() {
                var b = this._getIndex();
                this.data.m.splice(b, 1);
                this._save();
                if ((b = this.pageStore.get(this.CON_MANAGE_PAGE_LIST)) && "" != b) {
                    for (var b = b.split(","), c = 0; c < b.length; c++) if (b[c] == this.identid) {
                        b.splice(c, 1);
                        break
                    }
                    b = b.join(",");
                    "" != b ? this.pageStore.set(this.CON_MANAGE_PAGE_LIST, b) : this.pageStore.whereClear(this.CON_MANAGE_PAGE_LIST)
                }
            },
            _update: function(b) {
                this.data = this._get();
                this._clear(b);
                var b = "update",
                c = this._getIndex();
                this.data.t = a.formatDate();
                if (!this.data.m[c]) if (this.data.m.length < this.options.pageNum) b = "add",
                this.data.m[c] = {};
                else return;
                this.data.m[c][this.identid] = this._2shortTime();
                this._save();
                this.debug && a.Log(this.identid + ",pageCount:" + this.data.m.length + "," + b + " data:" + a.JSON.toJSONString(this.data.m));
                if (("add" == b || !0 !== this.chanageCall) && this.count != this.data.m.length) this.options.onChanage.call(this, this.data.m.length, this.data.m),
                this.count = this.data.m.length;
                this.chanageCall = !1
            },
            _clear: function(b) {
                var c = this._2shortTime();
                if (this.data.m.length) for (var a = 0,
                e; a < this.data.m.length; a++) if (this.data.m[a]) for (var f in this.data.m[a]) if ("function" != typeof this.data.m[a][f] && (e = c - this.data.m[a][f], Math.abs(e) > this.options.timeout + b / 100)) {
                    this.data.m.splice(a, 1);
                    this.chanageCall = !0;
                    e = this.pageStore.get(this.CON_MANAGE_PAGE_LIST);
                    if (!e || "" == e) return;
                    e = e.split(",");
                    for (var g = 0; g < e.length; g++) if (e[g] == f) {
                        e.splice(g, 1);
                        break
                    }
                    e = e.join(",");
                    "" != e ? this.pageStore.set(this.CON_MANAGE_PAGE_LIST, e) : this.pageStore.whereClear(this.CON_MANAGE_PAGE_LIST)
                }
            },
            _getIndex: function() {
                if (!this.data.m.length) return 0;
                for (var b = 0; b < this.data.m.length; b++) if (this.data.m[b]) for (var c in this.data.m[b]) if (this.data.m[b] && !a.isFunction(this.data.m[b][c]) && c === this.identid) return b;
                return b
            },
            _2shortTime: function(b, c, d) {
                b = (b ? b: a.getTime()).toString();
                return b.substring(c || 5, d || 11)
            }
        };
        q = a;
        var h = {
            disabled: !1
        },
        s = a.browser.msie,
        p;
        h.toJSONString = function(b) {
            return null == b ? "": a.JSON.toJSONString(b)
        };
        h.parseJSON = function(b) {
            if ("object" == typeof b) return b || r;
            try {
                return a.JSON.parseJSON(b)
            } catch(c) {
                return b || r
            }
        };
        if (function() {
            var b = null;
            try {
                b = window.localStorage
            } catch(c) {
                return a.Log("localStorage:" + c.message, 3),
                !1
            }
            if (b) try {
                return null !== localStorage.getItem("test") && localStorage.removeItem("test"),
                localStorage.setItem("test", "test"),
                "test" == localStorage.getItem("test") ? (localStorage.removeItem("test"), !0) : !1
            } catch(d) {
                return a.Log("The browser localStorage is unavailable. " + d.message, 3),
                !1
            }
        } ()) p = window.localStorage,
        h.set = function(b, c) {
            if (!c || c === r || null === c) return h.remove(b);
            try {
                "function" == typeof p.setItem ? p.setItem(b, h.toJSONString(c)) : p[b] = h.toJSONString(c)
            } catch(d) {
                if ("QUOTA_EXCEEDED_ERR" == d.name.toUpperCase()) {
                    h.remove(b);
                    try {
                        p.setItem(b, h.toJSONString(c))
                    } catch(e) {
                        a.Log("store.set:" + e.message, 3)
                    }
                }
            }
            return c
        },
        h.get = function(b) {
            return h.parseJSON(p.getItem(b))
        },
        h.remove = function(b) {
            try {
                p.removeItem(b)
            } catch(c) {
                a.Log("store.remove:" + c.message, 3)
            }
        },
        h.clear = function() {
            try {
                p.clear()
            } catch(b) {
                a.Log("store.clear:" + b.message, 3)
            }
        },
        h.getAll = function() {
            for (var b = {},
            c = 0; c < p.length; ++c) {
                var a = p.key(c);
                b[a] = h.get(a)
            }
            return b
        };
        else if (s) {
            var v = RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g"),
            t,
            u,
            s = function(b) {
                return function() {
                    var c;
                    c = Array.prototype.slice.call(arguments, 0);
                    c.unshift(p);
                    try {
                        t.appendChild(p)
                    } catch(a) {
                        t.insertBefore(p, t.firstChild)
                    }
                    p.addBehavior && p.addBehavior("#default#userData");
                    for (var e = 20; 0 < e;) {
                        e--;
                        try {
                            p.load("nTK-LS");
                            break
                        } catch(f) {}
                    }
                    c = b.apply(h, c);
                    t.removeChild(p);
                    return c
                }
            };
            try {
                u = new ActiveXObject("htmlfile"),
                u.open(),
                u.write('<script type="text/javascript">document.w=window;<\/script><iframe src="/favicon.ico"></iframe>'),
                u.close(),
                t = u.w.frames[0].document,
                p = t.createElement("div")
            } catch(x) {
                p = document.createElement("div"),
                t = document.body || document.getElementsByTagName("head")[0] || document.documentElement
            }
            h.set = s(function(b, c, a) {
                c = c.replace(v, "___");
                if (!a || a === r || null === a) return h.remove(c);
                b.setAttribute(c, h.toJSONString(a));
                try {
                    b.save("nTK-LS")
                } catch(e) {}
                return a
            });
            h.get = s(function(b, a) {
                a = a.replace(v, "___");
                return h.parseJSON(b.getAttribute(a))
            });
            h.remove = s(function(b, a) {
                a = a.replace(v, "___");
                b.removeAttribute(a);
                b.save("nTK-LS")
            });
            h.clear = s(function(b) {
                try {
                    var a = b.XMLDocument.documentElement.attributes
                } catch(d) {
                    return
                }
                b.load("nTK-LS");
                for (var e = 0,
                f = a.length; e < f; e++) b.removeAttribute(a[e].name);
                b.save("nTK-LS")
            });
            h.getAll = s(function(b) {
                try {
                    var a = b.XMLDocument.documentElement.attributes
                } catch(d) {
                    return
                }
                for (var e = {},
                f = 0,
                g = a.length; f < g; ++f) {
                    var k = a[f],
                    j = k.name.replace(v, "___");
                    e[k.name] = h.parseJSON(b.getAttribute(j))
                }
                return e
            })
        } else h.set = function() {
            a.Log("The browser localStorage is unavailable.", 3)
        },
        h.get = new Function,
        h.remove = new Function,
        h.clear = new Function,
        h.getAll = new Function;
        try {
            h.set("__cometd__", "__cometd__"),
            "__cometd__" != h.get("__cometd__") && (h.disabled = !0),
            h.remove("__cometd__")
        } catch(y) {
            h.disabled = !0
        }
        h.whereClear = function(b) {
            var c = this,
            d = this.getAll();
            a.each(d,
            function(a) { - 1 < a.indexOf(b) && c.remove(a)
            })
        };
        h.enabled = !h.disabled;
        q.store = h;
        a.comet = a.Class.create();
        a.comet.prototype = {
            name: "public.comet",
            version: "2014.05.17",
            connType: "login",
            options: null,
            fix: "",
            id: "",
            count: 0,
            sendIntervalID: null,
            _ipExpr: /^https?:\/\/\d+\.\d+\.\d+\.\d+(:\d+)?\/(.*?)$/gi,
            _cacheElement: {},
            _connectTimeID: {},
            defaultOption: {
                muDomain: 3,
                timeout: 20,
                onCallback: new Function,
                onComplete: new Function,
                onAbnormal: new Function,
                onTimeout: new Function
            },
            initialize: function(b, c) {
                var d = this;
                this.uri = b;
                this.fix = a.randomChar();
                this.uri || a.Log("comet uri is null", 3);
                this.callMethod = window;
                this.callbackName = "callback_" + this.fix;
                this.callMethod[this.callbackName] = function() {
                    d._connectCallback.call(d, d.id, arguments)
                };
                this.options = a.extend({},
                this.defaultOption, c);
                this.initConnectionPooling()
            },
            initMessageQueue: function() {
                this.messageQueue || (this.messageQueue = new a.Queue, this.messageQueue.addMessage = function(b) {
                    for (var a = 0; a < this.length; a++) if (this.list[a].msgid == b.msgid && this.list[a].index == b.index) return ! 1;
                    this.enQueue(b);
                    return ! 0
                },
                this.messageQueue.nextMessage = function(b, a) {
                    if (this.isEmpty()) return null;
                    if (!b) return this.queueFront();
                    for (var d = 0; d < this.length; d++) if (this.list[d].msgid == b && this.list[d].body.sendpacket == a) return this.list[d + 1]
                },
                this.messageQueue.removeMessage = function() {
                    for (var b = 0; b < this.length; b++);
                    this.list.splice(b, 1);
                    this.length = this.list.length
                })
            },
            initConnectionPooling: function() {
                if (!this.connectionPooling) {
                    this._ipExpr.test(this.uri) && (this.options.muDomain = 1);
                    this.connectionPooling = new a.Queue;
                    this.connectionPooling.get = function() {
                        for (var b, a, e = 0; e < this.list.length; e++) {
                            if (!1 === this.list[e].lock && (!b || b.rTimesample > this.list[e].rTimesample)) b = this.list[e];
                            if (!a || this.list[e].sTimesample < a.sTimesample) a = this.list[e]
                        }
                        b = b || a;
                        this.recover(b.uri, !0);
                        return b
                    };
                    this.connectionPooling.getConnect = function() {
                        var b = this.get();
                        return {
                            uri: b.uri,
                            url: b.uri + (/\?$/ig.test(b.uri) ? "&": "?")
                        }
                    };
                    this.connectionPooling.recover = function(b, d, e, f) {
                        for (var g = 0; g < this.list.length; g++) if (this.list[g].uri == b) return (this.list[g].lock = d) ? (this.list[g].sTimesample = e || a.getTime(), this.list[g].rTimesample = 0) : this.list[g].rTimesample = f || a.getTime(),
                        !0;
                        return ! 1
                    };
                    for (var b = 0; b <= this.options.muDomain; b++) this.connectionPooling.enQueue({
                        uri: 0 === b ? this.uri.toString().replace(/(https?:\/\/)(.*?)(\-\d+)?\./ig, "$1$2.") : this.uri.toString().replace(/(https?:\/\/)(.*?)(\-\d+)?\./ig, "$1$2-" + ( + b - 1) + "."),
                        lock: !1,
                        sTimesample: 0,
                        rTimesample: 0
                    })
                }
            },
            connect: function(b, c) {
                var d, e, f = this.count++;
                this.connType = "login";
                this.id = this.fix + "_" + f;
                b[c || "callbackname"] = this.callbackName;
                this.connectOptions = a.extend(b, {
                    ts: a.getTime()
                });
                d = this.connectionPooling.getConnect();
                e = d.url + a.toURI(this.connectOptions);
                this._cacheElement[this.id] = this._createConnect(e, this.id, f, d)
            },
            kalive: function(b, c) {
                var d, e, f = this.count++;
                this.connType = "kalive";
                this.id = this.fix + "_" + f;
                b[c || "callbackname"] = this.callbackName;
                this.kaliveOptions = a.extend(this.kaliveOptions, b, {
                    ts: a.getTime()
                });
                d = this.connectionPooling.getConnect();
                e = d.url + a.toURI(this.kaliveOptions);
                this._cacheElement[this.id] = this._createConnect(e, this.id, f, d)
            },
            disconnectServer: function(b, c) {
                return this.flashGoServer = this.connectionPooling.getConnect().url + a.toURI(!1 === c ? b: a.extend(b, {
                    ts: a.getTime()
                }))
            },
            disconnect: function() {
                a.require(this.flashGoServer,
                function(b) {
                    a(b.error ? b.target: b).remove()
                });
                window[this.callbackName] = new Function
            },
            reconnect: function() {
                this.connect(this.connectOptions)
            },
            send: function(b, c) {
                var d = this,
                e = this.connectionPooling.getConnect(),
                f = this.mdyServerAddr(e.url) + a.toURI(b);
                a.require(f + "#rnd",
                function(b) {
                    d.connectionPooling.recover(e.uri, !1);
                    c && c.call(d, b.error);
                    a(b.error ? b.target: b).remove()
                });
                return ! 0
            },
            mdyServerAddr: function(b) {
                return b.replace(/\/flashgo/i, "/httpgo")
            },
            post: function(b, c) {
                var d = this,
                e = this.connectionPooling.getConnect();
                new a.POST(this.mdyServerAddr(e.url), b,
                function() {
                    d.connectionPooling.recover(e.uri, !1);
                    c && c.call(d, !0)
                })
            },
            _createConnect: function(b, c, d, e) {
                var f = this,
                g, d = document.head || nTalk("head")[0] || document.documentElement;
                g = a({
                    className: c,
                    tag: "script",
                    type: "text/javascript",
                    async: "async",
                    src: b,
                    charset: "utf-8"
                }).appendTo(d);
                b = g.get(0).readyState ? "onreadystatechange": "onload";
                g.get(0)[b] = g.get(0).onerror = function(b) {
                    var d = g.get(0).readyState,
                    b = a.Event.fixEvent(b);
                    /^(loaded|complete|undefined)$/.test(d) && (f.connectionPooling.recover(e.uri, !1), "error" !== b.type ? setTimeout(function() {
                        f._connectComplete(b, c);
                        g.remove()
                    },
                    a.browser.msie ? 800 : 50) : (f._connectAbnormal(b, c), g.remove()))
                };
                this._connectTimeID[c] = setTimeout(function() {
                    g.first().remove();
                    f._connectTimeout("timeout", c)
                },
                1E3 * +this.options.timeout + 1E4);
                return g.get(0)
            },
            _connectCallback: function(b, c) {
                c = Array.prototype.slice.call(c);
                a("." + b).remove();
                this._cacheElement[b] ? (this._stopCallComplete(b, "callback"), this.options.onCallback.apply(self, [!0, c])) : this.options.onCallback.apply(self, [!1, c])
            },
            _connectComplete: function(b, a) {
                var d = Array.prototype.slice.call(arguments);
                this._cacheElement[a] && (this._stopCallComplete(a, "complete"), this.options.onComplete.apply(self, [this.connType].concat(d)))
            },
            _connectAbnormal: function(b, a) {
                var d = Array.prototype.slice.call(arguments);
                this._cacheElement[a] && (this._stopCallComplete(a, "abnormal"), this.options.onAbnormal.apply(self, [this.connType].concat(d)))
            },
            _connectTimeout: function(b, a) {
                var d = Array.prototype.slice.call(arguments);
                this._cacheElement[a] && (this._stopCallComplete(a, "timeout"), this.options.onTimeout.apply(self, [this.connType].concat(d)))
            },
            _stopCallComplete: function(b) {
                var c = this._cacheElement[b];
                c ? c.onload = c.onreadystatechange = c.onerror = new Function: a.Log("stop error id:" + b, 3);
                delete this._cacheElement[b];
                clearTimeout(this._connectTimeID[b]);
                delete this._connectTimeID[b]
            },
            _createScriptPCID: function(b) {
                return "guest" + [b ? "TEMP" + a.randomChar(4) : a.randomChar(8), a.randomChar(4), a.randomChar(4), a.randomChar(4), a.randomChar(12)].join("-")
            }
        };
        a.mqttws = a.Class.create();
        a.mqttws.prototype = {
            name: "public.mqttws",
            version: "2015.04.10",
            connect: null,
            subscriptions: [],
            messages: [],
            connected: !1,
            recCount: 0,
            waitTime: 500,
            _wsKeepaliveId: null,
            _options: {
                url: null,
                siteid: null,
                pcid: null,
                onCallback: null,
                loginMsg: null,
                timeout: 3,
                keepAliveInterval: 90
            },
            initialize: function(b) {
                var c = this;
                this.options = a.extend({},
                c._options, b);
                this.options.pcid = (this.options.siteid + "_" + this.options.pcid.substring(5)).substring(0, 23);
                a.require({
                    mqtt: "mosquitto.js?siteid=" + a.extParmas.siteid
                },
                function() {
                    c.connect = new a.Mosquitto;
                    c.connect.onmessage = function(b, e) {
                        var f = a.JSON.parseJSON(e);
                        c.options.onCallback.apply(this, [!0, [f.method].concat(f.params)])
                    };
                    c.connect.ondisconnect = function() {
                        null != this._wsKeepaliveId && (clearInterval(this._wsKeepaliveId), this._wsKeepaliveId = null)
                    };
                    c.connect.onconnect = function(b) {
                        0 == b ? (c.connect.subscribe("foo", 0), c.connect.publish("foo", c.options.loginMsg, 0, 0)) : c.reconnect()
                    };
                    c.connect.onreconnect = function() {
                        c.reconnect()
                    };
                    c.connect.connect(c.options.url, c.options.keepAliveInterval, c.options.pcid)
                })
            },
            reconnect: function() {
                var b = this;
                this._waitTime = 3 > ++this.recCount ? 500 : 1E3 * +"034567890".charAt(Math.ceil(5 * Math.random()));
                setTimeout(function() {
                    b.connect.connect(b.options.url, b.options.keepAliveInterval, b.options.pcid)
                },
                this._waitTime)
            },
            disconnect: function() {
                this.connect.closeFlag = !0;
                this.connect.disconnect()
            },
            kalive: function(b) {
                var a = this;
                this._wsKeepaliveId || (this._wsKeepaliveId = setInterval(function() {
                    a.connect.publish("foo", b, 0, !1)
                },
                1E3 * this.options.keepAliveInterval))
            }
        };
        a.extend({
            htmlToElement: function(b) {
                var c, d;
                if (a.browser.msie) try {
                    c = new ActiveXObject("MSXml.DOMDocument"),
                    c.loadXML(b),
                    d = c.childNodes
                } catch(e) {
                    c = document.createElement("DIV"),
                    c.innerHTML = b,
                    d = c.childNodes
                } else c = document.createElement("DIV"),
                c.innerHTML = b,
                d = c.childNodes;
                return d
            },
            elementToObject: function(b) {
                var c = {},
                d;
                d = a.isArray(b) || b.talkVersion ? b[0] : b;
                c[d.tagName.toLowerCase()] = d.innerHTML;
                if (d.attributes) for (var e = 0; e < d.attributes.length; e++) {
                    if (b = d.attributes[e].name) c[b] = d.attributes[e].value
                } else c.msg = d.textContent;
                return c
            },
            jsonToxml: function(b) {
                var c = this,
                d = "",
                e;
                if ("object" == typeof b) a.each(b,
                function(f, g) {
                    if ("string" == typeof g && "text" == f) d = g;
                    else if (a.isArray(b)) d += c.jsonToxml(g);
                    else {
                        d += "<" + f;
                        if ("object" == typeof g.attributes) {
                            for (var k in g.attributes) g.attributes.hasOwnProperty(k) && (d += " " + k + '="' + g.attributes[k] + '"');
                            delete g.attributes
                        }
                        e = c.jsonToxml(g);
                        d = g && e ? d + (">" + e + "</" + f + ">") : d + ("></" + f + ">")
                    }
                });
                else return b;
                return d
            },
            utils: {
                options: {},
                handleLinks: function(b, c) {
                    this.options = a.extend({},
                    this.options, c);
                    for (var b = b || "",
                    d = 0; d < this.linkPatterns.length; d++) b = b.replace(this.linkPatterns[d][0], this.linkPatterns[d][1]);
                    return b
                },
                linkPatterns: [[/\[link\s+reconnect=([^\s\[\]'"]+)\s*[^\[\]]*]([^\[\]]+)\[\/\s*link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'$1\').reconnect(this);return false;" >$2</a>'], [/\[link\s+message=([^\s\[\]'"]+)\s*[^\[\]]\s*source=([^\s\[\]'"]+)\s*[^\[\]]*]([^\[\]]+)\[\/\s*link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'$1\').switchUI(\'message\', $2);return false;" >$3</a>'], [/\[link\s+cancel=([^\s\[\]'"]+)\s+action=([^\s\[\]'"]+)\s*[^\[\]]*]([^\[\]]+)\[\/\s*link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'$1\').cancelUpload(\'$2\');return false;" >$3</a>'], [/\[link\s+resend=([^\s\[\]'"]+)\s+msgid=([^\s\[\]'"]+)\s*[^\[\]]*]([^\[\]]+)\[\/\s*link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'$1\').resend(\'$2\', this);return false;" >$3</a>'], [/\[link\s*manual=([^\s\[\]'"]+)](.*?)\[\/link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'$1\').switchServerType(true);return false;" >$2</a>'], [/\[link\s*artificial=([^\s\[\]'"]+)](.*?)\[\/link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'$1\').switchServerType(true);return false;" >$2</a>'], [/\[link\s*robot](.*?)\[\/link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get().switchServerType(false, 2);return false;" >$1</a>'], [/\[link\s*robotindex=([^\s\[\]'"]+)](.*?)\[\/link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;" href="javascript:void(0);" onclick="nTalk.chatManage.get(\'{$settingid}\').send(\'$1\');return false;">$2</a>'], [/\[link\s*href=(.*?)](.*?)\[\/link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;cursor:pointer;" href="$1">$2</a>'], [/\[link\s*(.*?)?](.*?)\[\/link]/gi, '<a style="' + a.STYLE_BODY + 'display:inline-block;color:#005ffb;text-decoration:none;cursor:pointer;" href="javascript:void(0);"' + (a.browser.iOS ? ' href="$1" target="_blank"': " onclick=\"window.open('$1')\"") + ">$2</a>"], [/\{\$(\w+)}/gi,
                function(b, c) {
                    return a.utils.options[c] || ""
                }]]
            },
            toHSL: function(b) {
                return a.isHex(b) ? a.rgb2HSL(a.hex2RGB(b)) : a.isRGB(b) ? a.rgb2HSL(b) : b
            },
            isHex: function(b) {
                return "string" == typeof b && /^#?([0-9a-f]{3}|[0-9a-f]{6})$/ig.test(b)
            },
            isRGB: function(b) {
                return a.isObject(b) && a.isDefined(b.r) && a.isDefined(b.g) && a.isDefined(b.b)
            },
            isHSL: function(b) {
                return a.isObject(b) && a.isDefined(b.h) && a.isDefined(b.s) && a.isDefined(b.l)
            },
            hex2RGB: function(b) {
                var b = b.toString().replace("#", ""),
                a = b.split(""),
                d = {};
                return d = 3 == b.length ? {
                    r: parseInt(a[0] + a[0], 16),
                    g: parseInt(a[1] + a[1], 16),
                    b: parseInt(a[2] + a[2], 16)
                }: 6 == b.length ? {
                    r: parseInt(a[0] + a[1], 16),
                    g: parseInt(a[2] + a[3], 16),
                    b: parseInt(a[4] + a[5], 16)
                }: {
                    r: 0,
                    g: 0,
                    b: 0
                }
            },
            rgb2HSL: function(b) {
                var a, d, e, f, g, k, j = {};
                a = b.r / 255;
                d = b.g / 255;
                b = b.b / 255;
                e = Math.min(a, d, b);
                k = Math.max(a, d, b);
                g = k - e;
                j.l = (k + e) / 2;
                0 == g ? (j.h = 0, j.s = 0) : (j.s = 0.5 > j.l ? g / (k + e) : g / (2 - k - e), e = ((k - a) / 6 + g / 2) / g, f = ((k - d) / 6 + g / 2) / g, g = ((k - b) / 6 + g / 2) / g, a == k ? j.h = g - f: d == k ? j.h = 1 / 3 - g + e: b == k && (j.h = 2 / 3 - e + f), 0 > j.h && (j.h += 1), 1 < j.h && (j.h -= 1));
                return j
            }
        });
        a.fn.extend({
            animate: function(b, c, d) {
                return a.each(this,
                function(e, f) {
                    a.animate(f, b, c, d)
                })
            },
            show: function(b, c) {
                a.isFunction(b) && (c = b, b = 500);
                return this.animate({
                    visibility: "visible",
                    opacity: {
                        from: 0,
                        to: 1
                    }
                },
                b || 500, c)
            },
            hide: function(b, c) {
                a.isFunction(b) && (c = b, b = 500);
                return this.animate({
                    opacity: {
                        to: 0
                    }
                },
                b || 500, c)
            },
            gradient: function(b, c, d) {
                var e, f;
                return b ? a.each(this,
                function(g, k) {
                    a.browser.oldmsie && (e = /top|bottom/.test(b) ? 0 : 1, /right|bottom/.test(b) && (f = c, c = d, d = f));
                    if (a.browser.webkit) {
                        switch (b) {
                        case "top":
                            e = "0% 100%,0% 0%";
                            break;
                        case "right":
                            e = "0% 0%,100% 0%";
                            break;
                        case "bottom":
                            e = "0% 0%,0% 100%";
                            break;
                        case "left":
                            e = "100% 0%,0% 0%"
                        }
                        a(k).css("background-image", !b ? "none": "-webkit-gradient(linear," + e + ",color-stop(1, " + c + "),color-stop(0, " + d + "))")
                    } else a.browser.gecko ? a(k).css("background-image", !b ? "none": "-moz-linear-gradient(" + b + ", " + c + ", " + d + ")") : a.browser.oldmsie ? k.style.filter = k.currentStyle.filter.replace(/progid:DXImageTransform\.Microsoft\.gradient\((.*?)\)\s*/gi, "") + (!b ? "": " progid:DXImageTransform.Microsoft.gradient(GradientType=" + e + ",startColorstr='" + c + "', endColorstr='" + d + "')") : a.browser.msie ? a(k).css("background-image", !b ? "none": "-ms-linear-gradient(" + b + ", " + c + ", " + d + ")") : a(k).css("background-image", !b ? "none": "linear-gradient(" + b + ", " + c + ", " + d + ")")
                }) : a.each(this,
                function(b, c) {
                    a.browser.oldmsie ? a(c).css("filter", "none") : a(c).css("background-image", "none")
                })
            }
        });
        a.extend({
            base64: {
                _strKey: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
                encode: function(b) {
                    for (var c = a.base64,
                    d = "",
                    e, f, g, k, j, l, h = 0,
                    b = c._utf8_encode(b || ""); h < b.length;) e = b.charCodeAt(h++),
                    f = b.charCodeAt(h++),
                    g = b.charCodeAt(h++),
                    k = e >> 2,
                    e = (e & 3) << 4 | f >> 4,
                    j = (f & 15) << 2 | g >> 6,
                    l = g & 63,
                    isNaN(f) ? j = l = 64 : isNaN(g) && (l = 64),
                    d = d + c._strKey.charAt(k) + c._strKey.charAt(e) + c._strKey.charAt(j) + c._strKey.charAt(l);
                    return d
                },
                decode: function(b) {
                    for (var c = a.base64,
                    d = "",
                    e, f, g, k, j, l = 0,
                    b = (b || "").replace(/[^A-Za-z0-9\+\/=]/g, ""); l < b.length;) e = c._strKey.indexOf(b.charAt(l++)),
                    f = c._strKey.indexOf(b.charAt(l++)),
                    k = c._strKey.indexOf(b.charAt(l++)),
                    j = c._strKey.indexOf(b.charAt(l++)),
                    e = e << 2 | f >> 4,
                    f = (f & 15) << 4 | k >> 2,
                    g = (k & 3) << 6 | j,
                    d += String.fromCharCode(e),
                    64 != k && (d += String.fromCharCode(f)),
                    64 != j && (d += String.fromCharCode(g));
                    return d = c._utf8_decode(d)
                },
                _utf8_encode: function(b) {
                    for (var b = b.replace(/\r\n/g, "\n"), a = "", d = 0; d < b.length; d++) {
                        var e = b.charCodeAt(d);
                        128 > e ? a += String.fromCharCode(e) : (127 < e && 2048 > e ? a += String.fromCharCode(e >> 6 | 192) : (a += String.fromCharCode(e >> 12 | 224), a += String.fromCharCode(e >> 6 & 63 | 128)), a += String.fromCharCode(e & 63 | 128))
                    }
                    return a
                },
                _utf8_decode: function(b) {
                    for (var a = "",
                    d = 0,
                    e, f, g; d < b.length;) e = b.charCodeAt(d),
                    128 > e ? (a += String.fromCharCode(e), d++) : 191 < e && 224 > e ? (f = b.charCodeAt(d + 1), a += String.fromCharCode((e & 31) << 6 | f & 63), d += 2) : (f = b.charCodeAt(d + 1), g = b.charCodeAt(d + 2), a += String.fromCharCode((e & 15) << 12 | (f & 63) << 6 | g & 63), d += 3);
                    return a
                }
            },
            FORM: {
                createInput: function(b, c, d) {
                    for (var e = [], f, g, k = a.browser.mobile, c = a.extend({
                        id: "",
                        rowspan: 0,
                        style: ""
                    },
                    c), j = '<span class="ntkf-text-red" style="' + a.STYLE_BODY + 'padding:2px 5px 2px 0;color:#f00;">' + (d || "") + "</span>", l = 0; l < b.length; l++) {
                        d = a.extend({
                            titlewidth: "80px",
                            inputwidth: "auto",
                            input: {
                                width: "90%",
                                height: "auto"
                            }
                        },
                        b[l]);
                        f = k ? d.title: d.title + (d.title.length == a.enLength(d.title) ? ":": "\uff1a");
                        /zh_cn|zh_tw/.test(a.lang.language) && 16 < a.enLength(d.title) || d.multipart || /radio|checkbox/.test(d.type) && 2 < d.options.length ? (d.multipart = !0, e.push(k ? '<tr style="' + a.STYLE_BODY + '"><td style="' + a.STYLE_BODY + 'width:100%;"><div style="' + a.STYLE_BODY + 'width:100%; line-height:14px; font-size:14px; font-weight:bold; text-align:center; color:#333333; margin: 15px 0px 20px 0px">' + f + "</div>": ['<tr style="', a.STYLE_BODY, '"><td style="', a.STYLE_BODY, 'vertical-align:top;line-height:28px;color:#333;" colspan="2"><div style="', a.STYLE_BODY, 'margin:5px 10px 5px 10px;color:#5a5a5a;">', f, !0 === d.required ? j: "", "</div></td></tr>", '<tr style="' + a.STYLE_BODY + '"><td style="', a.STYLE_BODY, 'padding:0 5px 0 0;text-align:right;vertical-align:top;line-height:28px;color:#333;"></td>', '<td style="' + a.STYLE_BODY + "line-height:28px;width:" + d.inputwidth + ';">'].join(""))) : e.push('<tr style="' + a.STYLE_BODY + '">' + (k ? "": '<td style="' + a.STYLE_BODY + "padding:0 5px 0 0;text-align:right;vertical-align:top;line-height:28px;color:#333;width:" + d.titlewidth + ';"><div style="' + a.STYLE_BODY + 'margin:4px 0 0 0;text-align:right;color:#5a5a5a;">' + (!0 === d.required ? j: "") + f + "</div></td>") + '<td style="' + a.STYLE_BODY + "line-height:28px;width:" + (k ? "100%": d.inputwidth) + ';">');
                        switch (d.type) {
                        case "select":
                            e.push('<select data-index="' + l + '" name="' + d.name + '" style="' + a.STYLE_BODY + "border:1px solid #ccc;height:24px;color:#333;margin:0 0 4px;line-height:20px;width:" + (k ? "99%": d.input.width) + ';">');
                            e.push('<option value="" style="' + a.STYLE_BODY + 'color:#ccc;">' + d.defaultText + "</option>");
                            for (g = 0; g < d.options.length; g++) f = d.options[g],
                            f = "string" == typeof f ? {
                                text: f,
                                value: f
                            }: f,
                            e.push('<option value="' + f.value + '" style="' + a.STYLE_BODY + 'color:#333;">' + f.text + "</option>");
                            e.push("</select>");
                            break;
                        case "radio":
                            e.push('<ul style="' + a.STYLE_BODY + 'list-style:none;">');
                            for (var h = 0,
                            p; h < d.options.length; h++) f = d.options[h],
                            f = "string" == typeof f ? {
                                text: f,
                                value: f
                            }: f,
                            p = d.name + "_" + h,
                            g = d.defaultText == f.value ? " checked": "",
                            e.push('<li class="form-item" style="' + a.STYLE_BODY + 'list-style:none;padding:0 2px 0 0;color:#000;float:left;"><input type="radio" name="' + d.name + '"id="' + p + '" value="' + f.value + '" _custom_text="' + f.text + '" style="' + a.STYLE_BODY + 'color:#333;display:inline-block"' + g + ' /><label for="' + p + '" style="' + a.STYLE_BODY + 'display:inline;color:#000;">' + f.text + "</label></li>");
                            e.push('<li style="' + a.STYLE_BODY + 'list-style:none;clear:both;width:0;height:0;"></li>');
                            e.push("</ul>");
                            break;
                        case "checkbox":
                            e.push('<ul style="' + a.STYLE_BODY + 'list-style:none;">');
                            for (h = 0; h < d.options.length; h++) f = d.options[h],
                            f = "string" == typeof f ? {
                                text: f,
                                value: f
                            }: f,
                            p = d.name + "_" + h,
                            g = d.defaultText == f.value ? " checked": "",
                            e.push('<li class="form-item" style="' + a.STYLE_BODY + 'list-style:none;padding:0 2px 0 0;float:left;"><input type="checkbox" name="' + d.name + '" id="' + p + '" value="' + f.value + '" _custom_text="' + f.text + '" style="' + a.STYLE_BODY + 'color:#333;"' + g + ' /><label for="' + p + '" style="' + a.STYLE_BODY + 'display:inline;color:#000;">' + f.text + "</label></li>");
                            e.push('<li style="' + a.STYLE_BODY + 'list-style:none;clear:both;width:0;height:0;"></li>');
                            e.push("</ul>");
                            break;
                        case "textarea":
                            e.push('<textarea data-index="' + l + '" name="' + d.name + '" style="' + a.STYLE_BODY + "border:1px solid #ccc;color:#ccc;width:" + (k ? "99%": d.input.width) + ";height:" + d.input.height + ';"' + (a.browser.html5 ? ' placeholder="' + d.defaultText + '">': ">" + d.defaultText) + "</textarea>");
                            break;
                        default:
                            e.push('<input data-index="' + l + '" type="text" name="' + d.name + '"' + (a.browser.html5 ? ' placeholder="' + d.defaultText + '" value=""': ' value="' + d.defaultText + '"') + ' maxlength="32" style="' + a.STYLE_BODY + "border:1px solid #ccc;height:24px;width:" + (k ? "99%": d.input.width) + ';margin:0 0 4px;color:#ccc;"'),
                            "phone" == d.verification && e.push(" onblur=\"this.value=this.value.replace(/[^0-9-]+/, '');\" onkeyup=\"var keyCode=(event || window.event).keyCode; if( !/16|17|35|36|37|38|39|40/i.test(keyCode) ){this.value=this.value.replace(/[^0-9-]+/, '');}\""),
                            e.push(" />")
                        }
                        d.messageid && (e.push('<div style="' + a.STYLE_BODY + 'display:none;color:#EF7208;" class="form-info ' + d.messageid + '">'), e.push('<div style="' + a.STYLE_BODY + "margin:2px;width:15px;height:15px;float:left;background:transparent url(" + a.sourceURI + '/images/chaticon.png) no-repeat -160px -39px;"></div>'), e.push('<div style="' + a.STYLE_BODY + 'color:#EF7208;float:left;" class="chat-view-info"></div>'), e.push('<div style="' + a.STYLE_BODY + 'clear:both;width:0;height:0;"></div>'), e.push("</div>"));
                        e.push("</td>");
                        c.style && 0 === l && e.push('<td style="' + a.STYLE_BODY + c.style + '" id="' + c.id + '" rowspan="' + c.rowspan + '"></td></tr>')
                    }
                    return e.join("")
                },
                bindFormEvent: function(b, c) {
                    a(c).find("input[type=text], textarea").bind("focus",
                    function() {
                        var c = a(this).css({
                            color: "#333",
                            "border-color": a.browser.mobile ? "#0079fe": "#666"
                        }),
                        e = c.attr("data-index") || 0;
                        b[e].defaultText == c.val() && c.val("")
                    }).bind("blur",
                    function() {
                        var c = a(this).css("border-color", "#ccc"),
                        e = c.attr("data-index") || 0,
                        e = b[e].defaultText;
                        "" === c.val() && c.val(e); ("" === c.val() || c.val() == e) && c.css("color", "#ccc")
                    })
                },
                verificationForm: function(b, c, d, e) {
                    for (var f, g, k = [], j, l, h = !1, p = /\d{6,}/i, q = /^[a-zA-Z0-9\._-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/i, m = 0; m < b.length; m++) {
                        switch (b[m].type) {
                        case "checkbox":
                            l = [];
                            f = a(d).find("input[name=" + b[m].name + "]");
                            g = a(d).find("input[name=" + b[m].name + "][checked]");
                            for (j = 0; j < g.length; j++) l.push({
                                value: g.get(j).value,
                                text: a(g.get(j)).attr("_custom_text")
                            });
                            break;
                        case "radio":
                            l = {
                                value: "",
                                text: ""
                            };
                            f = a(d).find("input[name=" + b[m].name + "]");
                            a(d).find("input[name=" + b[m].name + "][checked]").each(function(b, c) {
                                c.checked && (l = {
                                    value: a(c).val() || "",
                                    text: a(c).attr("_custom_text")
                                })
                            });
                            break;
                        case "select":
                            f = a(d).find("select[name=" + b[m].name + "]");
                            l = a("option[selected]", f).val() || "";
                            l = b[m].defaultText && l == b[m].defaultText ? "": l;
                            break;
                        case "textarea":
                            f = a(d).find("textarea[name=" + b[m].name + "]");
                            b[m].defaultText && b[m].defaultText == f.val() ? (l = "", f.val("")) : l = f.val().replace(/(^\s*)|(\s*$)/g, "");
                            break;
                        default:
                            f = a(d).find("input[name=" + b[m].name + "]"),
                            b[m].defaultText && b[m].defaultText == f.val() ? (l = "", f.val("")) : l = f.val().replace(/(^\s*)|(\s*$)/g, "")
                        }
                        g = "string" == typeof l ? "" === l || !l.length: a.isArray(l) ? 0 === l.length: "" === l.value;
                        j = b[m].messageid && b[m].message ? !0 : !1;
                        var r = a(d).find("." + b[m].messageid),
                        s = a(d).find("." + b[m].messageid + " .chat-view-info");
                        b[m].required && g ? (this.showError(j, b[m].message[0], s, r, f), h = !0) : "phone" == b[m].verification && !g && !p.test(l) ? (this.showError(j, b[m].message[1], s, r, f), h = !0) : "email" == b[m].verification && !g && !q.test(l) ? (this.showError(j, b[m].message[1], s, r, f), h = !0) : b[m].min && !g && a.enLength(l) < b[m].min ? (this.showError(j, b[m].message[1], s, r, f), h = !0) : b[m].max && !g && a.enLength(l) > b[m].max ? (this.showError(j, b[m].message[2], s, r, f), h = !0) : (j ? r.hide(function() {
                            a(this).display()
                        }) : /radio|checkbox/.test(b[m].type) ? f.parent().css("color", "#333") : f.css("border-color", "#DBD8D1"), g || k.push({
                            name: b[m].name,
                            title: b[m].title,
                            value: l
                        }))
                    }
                    h ? "function" == typeof e && e() : (a.Log("form submit complete, failCallback is null", 3), "function" == typeof c ? c(k) : a.Log("form submit complete, callback is null", 3))
                },
                showError: function(b, c, d, e, f) {
                    var g = this;
                    b && c ? a.browser.mobile ? (this.messageErrorToast && (this.messageErrorToast.remove(), this.messageErrorToast = null, messageErrorTimeout && clearTimeout(messageErrorTimeout)), b = 10 < c.length ? 300 : 250, this.messageErrorToast = new a.Toast('<div id="#message_error" style="position: relative;width: ' + (b - 50) + 'px; height:30px; line-height: 30px;z-index:100; color: #FFF; top: 30px; left: 25px; text-align:center;font-weight:bold">' + c + "</div>", {
                        width: b,
                        height: 90
                    }), this.messageErrorTimeout = setTimeout(function() {
                        g.messageErrorToast.remove();
                        g.messageErrorToast = null;
                        f.get(0).focus()
                    },
                    2E3)) : (d.html(c), e.display(1).show(), f.get(0).focus()) : /radio|checkbox/.test(fields[i].type) ? f.parent().css("color", "#f00") : f.css("border-color", "#f00").get(0).focus()
                }
            }
        });
        a.Transfer = a.Class.create();
        a.Transfer.prototype = {
            name: "Transfer",
            button: null,
            element: null,
            form: null,
            iframe: null,
            proxy: null,
            options: null,
            debug: !0,
            fkey: "",
            initialize: function(b, c) {
                this.button = c;
                var d = a.randomChar(16);
                this.options = a.extend({
                    onError: new Function,
                    onChange: new Function,
                    callback: new Function,
                    name: d,
                    curName: "",
                    compSize: 512E3,
                    params: {},
                    target: "iframe-transfer-" + d
                },
                b);
                if (this.options.server) {
                    this.proxy = a({
                        tag: "IFRAME",
                        name: "proxy-" + d,
                        src: this.options.server.substring(0, this.options.server.lastIndexOf("/")) + "/proxy.html?t=" + a.getTime(),
                        style: a.STYLE_NBODY + "width:0px;height:0px;display:none;"
                    }).appendTo(a(this.button)).get(0).contentWindow;
                    var e = this,
                    d = Math.max(20, this.button.width(), parseFloat(this.button.css("width"))),
                    f = Math.max(20, this.button.height(), parseFloat(this.button.css("height"))),
                    d = a.STYLE_BODY + "width:" + d + "px;height:" + f + "px;overflow:hidden;";
                    this.completed = function(a) { / ^( ? :loaded | complete | undefined) $ / .test(this.readyState) && (e.iframe.removeEvent("readystatechange", e.completed).removeEvent("load", e.completed), e.transferComplete(a, e.fkey))
                    };
                    this.form = a({
                        tag: "FORM",
                        action: "",
                        method: "POST",
                        target: this.options.target,
                        enctype: "multipart/form-data",
                        style: d
                    }).appendTo(this.button, !0);
                    this.iframe = a({
                        tag: "IFRAME",
                        name: this.options.target,
                        src: "about:blank",
                        style: d + "width:0;height:0;display:none;"
                    }).appendTo(this.button, !0);
                    this.element = a({
                        tag: "INPUT",
                        type: "file",
                        name: this.options.name,
                        accept: this.options.accept || "*",
                        style: d,
                        title: this.button.attr("title") || ""
                    }).appendTo(this.form, !0).css("opacity", 0);
                    this.element.click(function() {
                        "" !== this.value && e.form.get(0).reset();
                        e.iframe.bind("readystatechange", e.completed).bind("load", e.completed);
                        e.fkey = a.randomChar(16)
                    }).bind("change",
                    function(a) {
                        var b = {};
                        this.files ? (b.name = this.files[0].name, b.size = this.files[0].size) : (b.name = this.value.substring(this.value.lastIndexOf("\\") + 1), b.size = "");
                        b.name && (e.options.onChange(b), e.fileChange(a, this.files || this.value))
                    })
                } else a.Log("server is null", 3)
            },
            transferComplete: function(b, c) {
                var d = this;
                c && (this.debug && a.Log("$.upload.transferComplete(event, " + c + ")"), a.jsonp(this.options.server + "?" + a.toURI(a.extend({
                    getaction: 1,
                    fkey: c
                },
                this.options.params)) + "#rnd",
                function(b) {
                    d.debug && a.Log("get transfer file info:" + a.JSON.toJSONString(b), 1);
                    b.name = d.options.curName || d.options.name || "";
                    d.options.callback(b)
                }))
            },
            fileChange: function(b, c) {
                var d = this;
                this.isMobileCompTransf(c,
                function(e) {
                    e ? a.browser.oldAndroid ? a.require("jpeg_encoder_basic.js?siteid=" + d.options.params.siteid,
                    function() {
                        d.mobileCompTransf(b, c)
                    }) : d.mobileCompTransf(b, c) : d.commonTransf(b, c)
                })
            },
            isMobileCompTransf: function(b, c) {
                if (a.browser.mobile && (window.URL || window.webkitURL) && document.createElement("canvas")) if ( - 1 < b[0].name.toLowerCase().indexOf("jpg")) c(!0);
                else if (window.FileReader && window.DataView) {
                    var d = new FileReader;
                    d.onload = function(b) {
                        b = new DataView(b.target.result);
                        255 == b.getUint8(0) && 216 == b.getUint8(1) ? c(!0) : c(!1)
                    };
                    d.readAsArrayBuffer(b[0])
                } else c(!1);
                else c(!1)
            },
            commonTransf: function(b, c) {
                var d = "uploadfile" == this.options.params.action ? !0 : !1,
                e,
                f;
                try {
                    e = d ? this.proxy.fileOptions.fileMaxSize: this.proxy.fileOptions.imageMaxSize,
                    f = d ? this.proxy.fileOptions.fileExt: this.proxy.fileOptions.imageExt
                } catch(g) {
                    f = e = null
                }
                if ("string" === typeof c) this.debug && a.Log("Name: " + c, 2);
                else for (var k, d = 0; d < c.length; d++) {
                    var j = c[d];
                    k = -1 < j.name.indexOf(".") ? j.name.match(/\.[^\.]+$/)[0].replace(".", "").toLowerCase() : "";
                    if (this.options.maxSize && j.size > this.options.maxSize || e && j.size > e) {
                        this.options.onError({
                            type: 9,
                            name: j.name,
                            size: j.size,
                            etype: "SIZE",
                            maxSize: this.options.maxSize || e
                        });
                        return
                    }
                    if ("*" != this.options.accept && this.options.accept || f) {
                        if (this.options.accept && -1 < this.options.accept.indexOf("/*")) {
                            if (k = RegExp(this.options.accept.replace(/\//, "\\/"), "gi"), !k.test(j.type)) {
                                a.Log("accept:" + this.options.accept + ", type:" + j.type, 2);
                                this.options.onError({
                                    type: 9,
                                    name: j.name,
                                    size: j.size,
                                    etype: "TYPE"
                                });
                                return
                            }
                        } else {
                            if (this.options.accept && -1 >= this.options.accept.indexOf(j.type)) {
                                a.Log("accept:" + this.options.accept + ", type:" + j.type, 2);
                                this.options.onError({
                                    type: 9,
                                    name: j.name,
                                    size: j.size,
                                    etype: "TYPE"
                                });
                                return
                            }
                            if (f && -1 < f.indexOf(k)) continue;
                            else if (f && -1 == f.indexOf(k)) {
                                this.options.onError({
                                    type: 9,
                                    name: j.name,
                                    size: j.size,
                                    ext: f,
                                    etype: "TYPE"
                                });
                                return
                            }
                        }
                        this.options.curName = j.name;
                        this.debug && a.Log("Name: " + this.options.curName)
                    }
                }
                this.debug && a.Log("$.upload.fileChange()");
                this.form.attr("action", this.options.server + "?" + a.toURI(a.extend({
                    fkey: this.fkey,
                    rnd: a.getTime()
                },
                this.options.params)));
                a.browser.mobile && this.options.callback({
                    status: "startUpload",
                    oldfile: c[0].name
                });
                this.form.get(0).submit()
            },
            mobileCompTransf: function(b, c) {
                var d = this;
                this.options.callback({
                    status: "startCompress",
                    oldfile: c[0].name
                });
                new a.ImageOrientation(c[0],
                function(b, f) {
                    new a.CompressImg(c[0], {
                        orientation: f
                    },
                    function(b, e) {
                        d.formData = new FormData;
                        d.formData.append("base64", e);
                        d.formData.append("fname", a.getTime() + ".jpg");
                        d.options.action = "uploadimage";
                        d.options.siteid = d.options.params.siteid;
                        a.each(d.options,
                        function(b, a) {
                            d.formData.append(b, a)
                        });
                        d.uploadCallBack = function(b) {
                            "success" == b.status ? (b = b.event.target.responseText, d.options.callback(a.JSON.parseJSON(b))) : "error" == b.status && d.options.callback("error")
                        };
                        d.options.callback({
                            status: "startUpload",
                            oldfile: c[0].name,
                            compress: !0
                        });
                        try {
                            d.proxy.uploadFile(d.options.server, d.formData, d.uploadCallBack)
                        } catch(f) {
                            a.Log("base64 upload" + f.message, 3)
                        }
                    })
                })
            },
            base64Transf: function(b) {
                var c = this;
                this.fkey = a.getTime();
                new a.POST(this.options.server + "?action=uploadimage", a.extend({
                    base64: b,
                    fname: a.getTime() + ".png",
                    fkey: this.fkey,
                    rnd: a.getTime()
                },
                this.options.params),
                function(b) {
                    c.transferComplete(b, c.fkey)
                })
            }
        };
        a.CompressImg = a.Class.create();
        a.CompressImg.prototype = {
            ctx: null,
            canvas: null,
            url: null,
            image: null,
            blob: null,
            compBlob: null,
            dataurl: null,
            resize: {
                width: null,
                height: null
            },
            options: {
                width: null,
                height: null,
                quality: 0.7
            },
            initialize: function(b, c, d) {
                var e = this;
                this.url = window.URL || window.webkitURL;
                this.canvas = document.createElement("canvas");
                this.blob = "string" === typeof b ? b: this.url.createObjectURL(b);
                this.options = a.extend(c, this.options);
                this.image = new Image;
                this.image.onerror = function() {
                    a.Log("\u52a0\u8f7d\u56fe\u7247\u5931\u8d25\uff01")
                };
                this.image.onload = function(b) {
                    e.getCompImage();
                    d(b, e.dataurl);
                    for (var a in e) e.hasOwnProperty(a) && (e[a] = null)
                };
                this.image.crossOrigin = "*";
                this.image.src = e.blob
            },
            getCompImage: function() {
                this.ctx = this.canvas.getContext("2d");
                this.resize = this._getResize();
                this.canvas.width = this.resize.width;
                this.canvas.height = this.resize.height;
                this.ctx.fillStyle = "#fff";
                this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
                switch (this.options.orientation) {
                case 3:
                    this.ctx.rotate(180 * Math.PI / 180);
                    this.ctx.drawImage(this.image, -this.resize.width, -this.resize.height, this.resize.width, this.resize.height);
                    break;
                case 6:
                    this.ctx.rotate(90 * Math.PI / 180);
                    this.ctx.drawImage(this.image, 0, -this.resize.width, this.resize.height, this.resize.width);
                    break;
                case 8:
                    this.ctx.rotate(270 * Math.PI / 180);
                    this.ctx.drawImage(this.image, -this.resize.height, 0, this.resize.height, this.resize.width);
                    break;
                case 2:
                    this.ctx.translate(resize.width, 0);
                    this.ctx.scale( - 1, 1);
                    this.ctx.drawImage(this.image, 0, 0, this.resize.width, this.resize.height);
                    break;
                case 4:
                    this.ctx.translate(resize.width, 0);
                    this.ctx.scale( - 1, 1);
                    this.ctx.rotate(180 * Math.PI / 180);
                    this.ctx.drawImage(this.image, -this.resize.width, -this.resize.height, this.resize.width, this.resize.height);
                    break;
                case 5:
                    this.ctx.translate(resize.width, 0);
                    this.ctx.scale( - 1, 1);
                    this.ctx.rotate(90 * Math.PI / 180);
                    this.ctx.drawImage(this.image, 0, -this.resize.width, this.resize.height, this.resize.width);
                    break;
                case 7:
                    this.ctx.translate(resize.width, 0);
                    this.ctx.scale( - 1, 1);
                    this.ctx.rotate(270 * Math.PI / 180);
                    this.ctx.drawImage(this.image, -this.resize.height, 0, this.resize.height, this.resize.width);
                    break;
                default:
                    this.ctx.drawImage(this.image, 0, 0, this.resize.width, this.resize.height)
                }
                if (a.browser.oldAndroid) {
                    var b = new JPEGEncoder,
                    c = this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);
                    this.dataurl = b.encode(c, 100 * this.options.quality)
                } else this.dataurl = this.canvas.toDataURL("image/jpeg", this.options.quality);
                this.url.revokeObjectURL(this.blob)
            },
            _getResize: function() {
                var b = this.image,
                a = this.options.width,
                d = this.options.height,
                e = {
                    width: b.width,
                    height: b.height
                }; - 1 < "5678".indexOf(this.options.orientation) && (e.width = b.height, e.height = b.width);
                b = e.width / e.height;
                a && d ? b >= a / d ? e.width > a && (e.width = a, e.height = Math.ceil(a / b)) : e.height > d && (e.height = d, e.width = Math.ceil(d * b)) : a ? a < e.width && (e.width = a, e.height = Math.ceil(a / b)) : d && d < e.height && (e.width = Math.ceil(d * b), e.height = d);
                for (; 3264 <= e.width || 2448 <= e.height;) e.width *= 0.8,
                e.height *= 0.8;
                return e
            }
        };
        a.ImageOrientation = a.Class.create();
        a.ImageOrientation.prototype = {
            initialize: function(b, c) {
                if (!window.FileReader || !window.DataView) return 1;
                var d = this,
                e = new FileReader;
                e.onload = function(b) {
                    c(a.Event.fixEvent(b), d._readImageOrientation(b.target.result))
                };
                e.readAsArrayBuffer(b)
            },
            _readImageOrientation: function(b) {
                var a = new DataView(b);
                if (255 != a.getUint8(0) || 216 != a.getUint8(1)) return 1;
                for (var d = 2,
                b = b.byteLength,
                e; d < b;) {
                    if (255 != a.getUint8(d)) return 1;
                    e = a.getUint8(d + 1);
                    if (225 == e) return this._getOrientationFromExif(a, d + 4, a.getUint16(d + 2) - 2);
                    d += 2 + a.getUint16(d + 2)
                }
            },
            _getOrientationFromExif: function(b, a) {
                if ("Exif" != this._getStringFromDB(b, a, 4)) return 1;
                var d, e = a + 6;
                if (18761 == b.getUint16(e)) d = !1;
                else if (19789 == b.getUint16(e)) d = !0;
                else return 1;
                if (42 != b.getUint16(e + 2, !d)) return 1;
                var f = b.getUint32(e + 4, !d);
                return 8 > f ? 1 : this._getOrientationFromTag(b, e, e + f, d)
            },
            _getOrientationFromTag: function(b, a, d, e) {
                var f = b.getUint16(d, !e),
                g,
                h,
                j;
                for (j = 0; j < f; j++) if (g = d + 12 * j + 2, h = b.getUint16(g, !e), 274 == h) return this._getOrientationValue(b, g, a, d, e);
                return 1
            },
            _getOrientationValue: function(a, c, d, e, f) {
                var g = a.getUint16(c + 2, !f),
                e = a.getUint32(c + 4, !f),
                d = a.getUint32(c + 8, !f) + d;
                switch (g) {
                case 3:
                    if (1 == e) return a.getUint16(c + 8, !f);
                    c = 2 < e ? d: c + 8;
                    d = [];
                    for (g = 0; g < e; g++) d[g] = a.getUint16(c + 2 * g, !f);
                    return d
                }
            },
            _getStringFromDB: function(a, c, d) {
                var e = "";
                for (n = c; n < c + d; n++) e += String.fromCharCode(a.getUint8(n));
                return e
            }
        };
        a.DialogChat = new a.Class.create;
        a.DialogChat.prototype = {
            contains: null,
            background: null,
            iframe: null,
            display: !1,
            selector: "",
            def: {
                close: !1,
                parent: window,
                margin: 10,
                border: 0,
                style: {
                    height: "auto"
                },
                resizeFunc: null
            },
            options: null,
            _funcResize: new Function,
            initialize: function(b, c) {
                var d = this;
                this.options = a.extend({},
                this.def, c);
                this.id = a.randomChar();
                this.selector = ".dialog-container-" + this.id;
                this._create();
                this._style(this.options.style);
                this.display = !0;
                this.options.close && (b += '<div class="dialog-button-close" style="' + a.STYLE_NBODY + 'font-size:14px;position:absolute;right:10px;top:10px;width:20px;height:20px;line-height:20px;text-align:center;cursor:pointer;">x</div>');
                this.container.html(b);
                setTimeout(function() {
                    d.container.css({
                        top: Math.max(0, (a(d.options.parent).height() - Math.max(d.container.height(), 200)) / 2) + "px"
                    })
                },
                5);
                this._funcResize = function() {
                    d.resize()
                };
                this.options.parent == window && a(window).addEvent("resize", this._funcResize);
                this.container.find(".dialog-button-close").click(function() {
                    d.close()
                })
            },
            close: function() {
                var b = this;
                this.options.parent == window && a(window).removeEvent("resize", this._funcResize);
                a(this.selector).hide(function() {
                    a(".dialog-iframe-" + b.id + ",.dialog-background-" + b.id).remove();
                    a(b.selector).remove();
                    b.display = !1
                })
            },
            resize: function(b, c) {
                b = b || a(this.options.parent).width();
                c = c || a(this.options.parent).height();
                a(".dialog-iframe-" + this.id + ",.dialog-background-" + this.id).css({
                    width: b + "px",
                    height: c + "px"
                });
                var d = "auto" === this.options.style.height ? "auto": c - 2 * this.options.margin - 2 * this.options.border;
                this.container.css({
                    width: b - 2 * this.options.margin - 2 * this.options.border + "px",
                    height: "auto" == d ? "auto": d + "px",
                    "max-width": b + "px",
                    "max-height": c - 40 + "px"
                });
                this.container.css("top", Math.max(0, (c - Math.max("auto" == d ? this.container.height() : d, 200)) / 2) + "px");
                this.options.resizeFunc && this.options.resizeFunc.call()
            },
            _create: function() {
                var b = this.options.parent == window ? document.body: this.options.parent,
                c = this.options.parent == window ? "fixed": "absolute";
                this.iframe = a({
                    tag: "IFRAME",
                    className: "dialog-iframe-" + this.id,
                    style: a.STYLE_NBODY + "position:" + c + ";display:none;left:0;top:0;margin:0;padding:0;border:0;width:100%;z-index:8888;"
                }).appendTo(b);
                this.background = a({
                    tag: "div",
                    className: "dialog-background-" + this.id,
                    style: a.STYLE_NBODY + "position:" + c + ";left:0;top:0;margin:0;padding:0;border:0;width:100%;background-color:#000;z-index:8888;"
                }).appendTo(b);
                this.container = a({
                    tag: "div",
                    className: "dialog-container-" + this.id,
                    style: a.STYLE_BODY + "position:" + c + ";left:0;top:0;margin:0;min-height:" + (this.options.minHeight ? this.options.minHeight: 200) + "px;border-radius:0px;z-index:" + (a.browser.mobile ? 9E3: 2147483647) + ";background:#fff;overflow-x:hidden;overflow-y:auto;"
                }).appendTo(b)
            },
            _style: function(b) {
                var c = a(this.options.parent).width(),
                d = a(this.options.parent).height();
                a(".dialog-iframe-" + this.id + ",.dialog-background-" + this.id).css({
                    width: c + "px",
                    height: a(this.options.parent).height() + "px"
                });
                this.background.css({
                    opacity: 0.6
                });
                var e = (this.options.margin + "").split(" ");
                1 == e.length && e.push(this.options.margin);
                this.container.css(b).css({
                    left: e[0] + "px",
                    top: e[1] + "px",
                    width: c - 2 * e[0] - 2 * this.options.border + "px",
                    height: "auto" === this.options.style.height ? "auto": d - 2 * e[1] - 2 * this.options.border + "px"
                })
            }
        };
        a.Toast = new a.Class.create;
        a.Toast.prototype = {
            id: null,
            container: null,
            toast: null,
            options: {},
            initialize: function(b, c) {
                var d = this;
                this.id = a.randomChar();
                this.options = a.extend(this.options, c);
                this.toastOpacity = a({
                    tag: "div",
                    className: "toast-opacity-" + this.id,
                    style: a.STYLE_BODY + "position:relative;z-index:9000;width:" + this.options.width + "px;height:" + this.options.height + "px;margin-left:" + (a(window).width() - this.options.width) / 2 + "px;margin-top:" + (a(window).scrollTop() + (a(window).height() - this.options.height - 100) / 2) + "px;background-color:#000;opacity:0.5;border-radius:5px;font-size:16px;color:white;text-align:center;line-height:" + this.options.height + "px"
                });
                this.toast = a({
                    tag: "div",
                    className: "toast-" + this.id,
                    style: a.STYLE_BODY + "position:relative;z-index:10000;width:" + this.options.width + "px;height:" + this.options.height + "px;margin-left:" + (a(window).width() - this.options.width) / 2 + "px;margin-top:" + -this.options.height + "px;background-color:none;border-radius:5px;font-size:16px;color:white;text-align:center;line-height:" + this.options.height + "px"
                });
                this.toast.html(b);
                this._create();
                this._funcResize = function() {
                    d.resize()
                };
                this._funRemove = function() {
                    d.remove()
                };
                a(window).addEvent("resize", this._funcResize)
            },
            _create: function() {
                this.toastOpacity.appendTo(document.body);
                this.toast.appendTo(document.body)
            },
            change: function(b) {
                a(".toast-" + this.id).html(b)
            },
            resize: function() {
                var b = a(window).width(),
                c = a(window).height(),
                d = 0 < (b - this.options.width) / 2 ? (b - this.options.width) / 2 : 0,
                e = 0 < (c - this.options.height - 100) / 2 ? a(window).scrollTop() + (c - this.options.height - 100) / 2 : a(window).scrollTop();
                a(".toast-opacity-" + this.id).css({
                    "margin-left": d + "px",
                    "margin-top": e + "px",
                    "max-width": b + "px",
                    "max-height": c + "px"
                });
                a(".toast-" + this.id).css({
                    "margin-left": d + "px",
                    "margin-top": -this.options.height + "px",
                    "max-width": b + "px",
                    "max-height": c + "px"
                })
            },
            remove: function() {
                a(".toast-opacity-" + this.id).remove();
                a(".toast-" + this.id).remove()
            }
        };
        a.GifTimer = a.Class.create();
        a.GifTimer.prototype = {
            id: null,
            inter: null,
            timeout: null,
            options: {
                inTimeFunc: null,
                outTimeFunc: null,
                doTime: null,
                allTime: null
            },
            initialize: function(b) {
                var c = this;
                this.options = a.extend(this.options, b);
                this.inter = setInterval(function() {
                    c.options.inTimeFunc.call(c)
                },
                this.options.doTime);
                this.timeout = setTimeout(function() {
                    clearInterval(c.inter);
                    c.options.outTimeFunc.call(c)
                },
                this.options.allTime)
            },
            remove: function() {
                a.Log("giftimer remove");
                clearInterval(this.inter);
                clearTimeout(this.timeout);
                this.timeout = this.inter = null
            }
        };
        a.Music = a.Class.create();
        a.Music.prototype = {
            msgid: null,
            url: null,
            type: null,
            duration: null,
            audioFlag: !0,
            musicEl: null,
            viewCallback: null,
            eventCallback: null,
            container: null,
            debugStr: "[nTalk Music]: ",
            initialize: function(a, c, d, e, f, g, h) {
                this.msgid = a;
                this.url = c;
                this.type = d;
                this.duration = e;
                this.viewCallback = f;
                this.eventCallback = g;
                this.container = h; (this.audioFlag = this.canPlayAudioMP3()) ? this.createAudioPlayer() : this.createSwfPlayer();
                this.viewCallback.call(this, "init");
                this.eventCallback.call(this, "init")
            },
            createAudioPlayer: function() {
                var b = this;
                this.musicEl = document.createElement("audio");
                this.musicEl.src = this.url;
                this.musicEl.type = this.type;
                this.musicEl.stop = function() {
                    this.pause();
                    this.currentTime = 0
                };
                a.Event.addEvent(this.musicEl, "ended",
                function() {
                    a.Log(b.debugStr + " trigger ended stop mp3");
                    b.viewCallback.call(b, "stop")
                });
                this.musicEl.getPaused = function() {
                    return this.paused
                }
            },
            createSwfPlayer: function() {
                var b = this,
                c = "ntalker_swf_mp3Player_container_" + this.msgid,
                d = "ntalker_swf_mp3player_" + this.msgid,
                e = a.flashHtml(d, a.sourceURI + "fs/music.swf", "id=" + d);
                this.musicEl = document.createElement("div");
                this.musicEl.innerHTML += e;
                this.musicEl.id = c;
                this.container.append(this.musicEl.outerHTML);
                var f = a.browser.msie && 7 >= a.browser.ieversion ? window[d] : document[d];
                setTimeout(function() {
                    f.emit("load", b.url);
                    f.emit("stop");
                    b.musicEl.play = function() {
                        f.emit("play")
                    };
                    b.musicEl.stop = function() {
                        f.emit("stop")
                    };
                    b.musicEl.getPaused = function() {
                        return 0 == f.getPaused()
                    }
                },
                1E3)
            },
            emit: function() {
                this.musicEl.getPaused() ? this.play() : this.stop()
            },
            play: function() {
                a.Log(this.debugStr + "play mp3");
                this.musicEl.play();
                this.viewCallback.call(this, "play")
            },
            stop: function() {
                a.Log(this.debugStr + "stop mp3");
                this.musicEl.stop();
                this.viewCallback.call(this, "stop")
            },
            canPlayAudioMP3: function() {
                try {
                    var a = document.createElement("audio");
                    return ! (!a.canPlayType || !a.canPlayType("audio/mpeg;").replace(/no/, ""))
                } catch(c) {
                    return ! 1
                }
            }
        };
        a.paste = a.Class.create();
        a.paste.prototype = {
            data: null,
            callback: null,
            debugStr: "[nTalk pasteDate]: ",
            initialize: function(a, c) {
                this.data = a.clipboardData || window.clipboardData;
                this.callback = c
            },
            getImgBase64Str: function() {
                var b = this,
                c = this.data;
                if (!c) return null;
                if ("function" == typeof webInfoChanged) this.callback(c.getData("image/x-vnd.adobe.air.bitmap").toDataURL());
                else if (a.browser.chrome || a.browser.opera) {
                    var d, e = c.items;
                    if (e) {
                        d = e[0];
                        for (var c = c.types || [], f = 0, g = c.length; f < g; f++) if ("Files" === c[f]) {
                            d = e[f];
                            break
                        }
                        d && "file" === d.kind && d.type.match(/^image\//i) ? (d = d.getAsFile(), e = new FileReader, e.onload = function(a) {
                            b.callback(a.target.result)
                        },
                        e.readAsDataURL(d)) : this.callback()
                    }
                } else this.callback()
            }
        }
    }
})(nTalk);

/* @file im.js
 * @date 2016.04.28 03:22:50 
 */
(function(a) {
    a.im || (a.tipsicon = a.sourceURI + "images/tipsicon." + (a.browser.msie6 ? "gif": "png"), a.extend({
        CON_LCRM_FIX: "LCRM_",
        currentCount: 0,
        im: {
            connect: null,
            time: 3,
            args: null,
            options: null,
            tipElement: null,
            isInvite: !1,
            start: function() {
                var b = this;
                this.connect ? a.Log("im connected", 2) : (this.options = {
                    siteid: a.global.siteid,
                    settingid: a.global.settingid,
                    surl: a.server.flashserver,
                    r: a.baseURI,
                    ref: a.referrer,
                    fsid: a.global.trailid,
                    cid: a.global.pcid,
                    presenceserver: a.server.presenceserver,
                    presencegoserver: a.server.presencegoserver,
                    t2dstatus: a.server.t2dstatus,
                    crmcenter: a.server.crmcenter,
                    coopserver: a.server.coopserver,
                    loadnid: a.CON_LOAD_MODE_NID
                },
                a.user.id && (this.options = a.merge(this.options, a.whereGet(a.user, ["id", "name"], ["u", "n"]))), a.require({
                    comet: "nt2.js?siteid=" + a.extParmas.siteid
                },
                function(c) {
                    c ? (b.connect = new a.connectPresence(b.options, a.server.close_im_flash || "0", a.server.connect_type), a.IMPRESENCE = b.connect, a.promptwindow.callbackFocus = function() {
                        b.onPageFocus()
                    },
                    a.promptwindow.callbackBlur = function() {
                        b.onPageBlur()
                    },
                    a.listenMouseOutEvent(), setInterval(function() {
                        b.intervalVerify()
                    },
                    5E3), a.moveCheck = setInterval(function() {
                        0 == a.moveTime && (1 == a.currentCount && a.moveCheckFlag) && (a.moveCheckFlag = !1, setTimeout(function() {
                            0 == a.moveTime && 1 == a.currentCount && a.showBeforeLeavePlan();
                            a.moveCheckFlag = !0
                        },
                        2E3))
                    },
                    1E3)) : a.Log("Loaded $comet mode failed", 3)
                }))
            },
            callReceiveSysMessage: function(b, c) {
                var d, e, f;
                e = b.id || ""; ! b.settingid && e && (f = e.split("_").splice(0, 2).join("_"), b.settingid = -1 < a.global.settingid.indexOf(f) || f.indexOf("kf_") ? a.global.settingid: f + "_9999");
                switch (b.calltype) {
                case 10:
                    a.browser.mobile && a.global.pageinchat ? a.isFunction(im_receiveMessage) && im_receiveMessage(b.settingid, c) : a.chatManage && (d = a.chatManage.get(b.settingid, e)) ? (d.reconnect(null, e, -1), a.chatManage.callReceive(d.settingid)) : 3 == a.server.isnoim ? a.im_openInPageChat(b.settingid, "", e, {
                        single: -1,
                        autoconnect: !0
                    },
                    "") : a.im.showTips(b, c);
                    break;
                case 1:
                case 2:
                    a.base.startLCrm(b.content);
                    break;
                default:
                    b.autoOpen || 3 == a.server.isnoim ? (a.im && a.im.refuseInvite(e, b.inviteid, 0), a.chatManage && (d = a.chatManage.get(b.settingid, e)) ? (d.reconnect(null, e, -1), a.chatManage.callReceive(d.settingid)) : a.im_openInPageChat && a.im_openInPageChat(b.settingid, "", e, {
                        single: -1,
                        autoconnect: 1
                    },
                    "")) : this.showTips(b, c, !0)
                }
            },
            onPageFocus: function() {
                a.IMPRESENCE.setPageFocus(!0, a.title, a.url, 0);
                this.intervalVerify()
            },
            onPageBlur: function() {
                a.IMPRESENCE.setPageFocus(!1)
            },
            intervalVerify: function() {
                var b, c;
                b = a.loadLCrm();
                a.each(b,
                function(b, e) {
                    1 != e.trigger && a.im.connect.currentPage.get() && (c = a.extend(e, {
                        cw: a.currentCount
                    }), a.base.startLCrm(c, !1, !0), a.flashData.remove(a.CON_LCRM_FIX + c.token))
                })
            },
            showTips: function(b, c, d) {
                this.settingid = b.settingid || a.global.settingid || "";
                this.destid = b.id || "";
                this.sessionid = b.sid || "";
                this.inviteid = b.inviteid || "";
                this.isInvite = d;
                b = this.destid.split("_ISME9754_T2D_");
                this.sellerid = -1 < b[0].indexOf("kf_") || b[0] == a.global.siteid ? "": b[0];
                a.require(a.tipsicon,
                function(b) {
                    b.error && a.Log("cache chat icon failure", 3)
                });
                this._createTips();
                this.tipElement.find(".ntalk-tips-body").html(c);
                this.tipElement.find(".ntalk-tips-button").html("\u7acb\u523b\u54a8\u8be2");
                a.promptwindow.startPrompt("", a.lang.news_new, !0)
            },
            hideTips: function() {
                var b = this;
                this.tipElement && this.tipElement.length && this.tipElement.hide(500,
                function() {
                    a(this).remove();
                    b.tipElement = null
                })
            },
            openChat: function() {
                this.hideTips();
                a.browser.mobile || !a.global.pageinchat ? a.im_openOutPageChat(this.settingid, "", this.destid, {
                    manual: 1
                },
                "", this.sellerid) : a.im_openInPageChat(this.settingid, "", this.destid, {
                    single: -1,
                    autoconnect: this.isInvite ? -1 : 1,
                    manual: 1
                },
                "")
            },
            _createTips: function() {
                var b = this;
                if (!this.tipElement || !this.tipElement.length) {
                    var c = ['<div class="ntalk-tips-background" style="margin:0;padding:10px;border:0;background:url(', a.tipsicon, ') no-repeat 0 0;color:#333333;font:normal 12px/160% Arial,SimSun;text-align:left;height:150px;width:205px;"><div class="ntalk-tips-body" style="margin:0;padding:0;border:0;float:left;font:normal 12px/160% Arial,SimSun;color:#333;height:60px;overflow:hidden;text-align:left;white-space:normal;width:156px;word-break:break-all;"></div><div class="ntalk-tips-close" style="background:url(', a.tipsicon, ') no-repeat -7px -120px;margin:5px;padding:0;border:0;cursor:pointer;font:normal 1px/1px Arial;height:20px;left:166px;position:absolute;top:0px;width:20px;"></div><div class="ntalk-tips-button" style="background:#008CD4;margin:0;padding:0;border:0;color:#FFFFFF;cursor:pointer;height:24px;left:105px;font:normal 12px/24px Arial,SimSun;position:absolute;text-align:center;top:78px;width:69px;"></div></div>'].join("");
                    this.tipElement = a({
                        className: "ntalk-tips-container",
                        style: "margin:0;padding:0;border:none;float:none;font:normal normal normal 12px/160% Arial,SimSun;width:206px;height:112px;z-index:99999;"
                    }).appendTo(!0).fixed({
                        right: 0,
                        bottom: 0
                    }).html(c);
                    this.tipElement.click(function(c) {
                        a.Event.fixEvent(c).stopPropagation();
                        b.openChat()
                    });
                    this.tipElement.find(".ntalk-tips-button").click(function(c) {
                        a.Event.fixEvent(c).stopPropagation();
                        b.openChat()
                    }).hover(function() {
                        a(this).css("background", "#007AB9")
                    },
                    function() {
                        a(this).css("background", "#008CD4")
                    });
                    this.tipElement.find(".ntalk-tips-close").click(function(c) {
                        a.Event.fixEvent(c).stopPropagation();
                        b.hideTips()
                    }).hover(function() {
                        a(this).css("background-position", "-27px -120px")
                    },
                    function() {
                        a(this).css("background-position", "-7px -120px")
                    })
                }
            },
            refuseInvite: function(b, c, d) {
                a.server.presencegoserver ? !b || !c ? a.Log("auto invite", 1) : a.require(a.server.presencegoserver + "?" + a.toURI({
                    action: "",
                    query: "invtrst",
                    suid: a.user.id,
                    duid: b,
                    rst: d,
                    invid: c,
                    tk: a.global.userToken
                }) + "#rnd") : a.Log("presencegoserver is null", 2)
            }
        }
    }), a.extend({
        listenMouseEvent: !1,
        lcrmGoAwayClientY: 0,
        lcrmGoAwayView: !1,
        moveTime: 0,
        moveCheck: null,
        moveCheckFlag: !0,
        loadLCrm: function() {
            var b = a.flashData.get(),
            c = {},
            d;
            for (d in b)"function" != typeof b[d] && b[d] && -1 < d.indexOf(a.CON_LCRM_FIX) && (c[d] = b[d]);
            return c
        },
        listenMouseOutEvent: function(b) {
            var c = this,
            d = function(b) {
                b = a.Event.fixEvent(b); (b.relatedTarget || b.toElement) && !c.lcrmGoAwayView && c.setMouseOutWindow(b, !1)
            },
            e = function(b) {
                b = a.Event.fixEvent(b); ! b.relatedTarget && !b.toElement && (c.setMouseOutWindow(b, !0), c.moveTime = 0)
            },
            f = function(b) {
                b = a.Event.fixEvent(b);
                c.setMouseOutWindow(b, "mousemove");
                null != a.moveCheck && (a.moveCheck = null);
                c.moveTime = a.getTime()
            }; ! this.listenMouseEvent && !a.browser.mobile && (this.listenMouseEvent = !0, !0 === b ? (a(document).removeEvent("mouseover", d), a(document).removeEvent("mouseout", e), a(document).removeEvent("mousemove", f)) : (a(document).addEvent("mouseover", d), a(document).addEvent("mouseout", e), a(document).addEvent("mousemove", f)))
        },
        setMouseOutWindow: function(b, c) {
            "mousemove" === c ? this.lcrmGoAwayClientY = 0 < b.clientY ? b.clientY: this.lcrmGoAwayClientY: (this.lcrmGoAwayView = c, 0 > b.clientY && 50 > this.lcrmGoAwayClientY && 1 == a.currentCount && setTimeout(function() {
                0 == a.moveTime && a.showBeforeLeavePlan()
            },
            500))
        },
        _getExistPageList: function() {
            try {
                return a.store.get("IM_EXIST_PAGEARR").split(",")
            } catch(b) {
                return []
            }
        },
        showBeforeLeavePlan: function() {
            var b, c;
            b = a.loadLCrm();
            a.each(b,
            function(b, e) {
                0 != e.trigger && (c = a.extend(e, {
                    trigger: 0,
                    cw: a.currentCount
                }), a.base.startLCrm(c, !1, !0), a.flashData.remove(a.CON_LCRM_FIX + c.token))
            })
        }
    }), a.extend({
        fIM_onPresenceReceiveSysMessage: function(b, c) {
            a.Log('$.fIM_onPresenceReceiveSysMessage("' + b + '", "' + a.JSON.toJSONString(c) + '")', 1);
            setTimeout(function() {
                var b, e, f;
                e = a.clearHtml(c.substr(0, c.indexOf("ntalker://")));
                f = c.substr(c.indexOf("ntalker://") + 10);
                try {
                    b = a.JSON.parseJSON(f)
                } catch(h) {
                    a.Log("nTalk.fIM_onPresenceReceiveSysMessage():" + h.message, 3);
                    return
                }
                a.im.callReceiveSysMessage(b, e)
            },
            0);
            return ! 0
        },
        fIM_onGetFlashServer: function() {
            return ! 0
        },
        connectStatus: -1,
        fIM_updateUserStatus: function(b, c) {
            setTimeout(function() {
                a.Log("$.fIM_updateUserStatus(" + b + ', "' + c + '")');
                a.connectStatus = b;
                if (2 == a.connectStatus) try {
                    a.IMPRESENCE.setPageFocus(!0, a.title, a.url, 1)
                } catch(d) {
                    a.Log(d, 3)
                }
            },
            0);
            return ! 0
        },
        fIM_presenceSetIMSid: function(b) {
            a.Log("fIM_presenceSetIMSid(userToken:" + b + ")", 1);
            a.global.userToken = b;
            return ! 0
        },
        fIM_presenceSetMyClientID: function(b) {
            a.url_presenceFlashGoUrl = b;
            return ! 0
        },
        flashData: {
            debug: !1,
            reNumber: 0,
            sessionData: null,
            checkFlash: function(b) { ! a.IMPRESENCE || !a.isFunction(a.IMPRESENCE.setJSData) ? 3 < this.reNumber || (this.reNumber++, setTimeout(b, 500)) : b.call(this)
            },
            add: function(b, c) {
                c && (c = this.filter(a.JSON.toJSONString(c), !0));
                this.debug && a.Log("$.flashData.add(k:" + b + ", v:" + c + ")", 1);
                this.checkFlash(function() {
                    try {
                        return a.IMPRESENCE.setJSData(a.global.trailid, b, c),
                        !0
                    } catch(d) {
                        return ! 1
                    }
                })
            },
            remove: function(a) {
                this.add(a, null, !1)
            },
            clearAll: function() {
                this.checkFlash(function() {
                    try {
                        return NTKF.IMPRESENCE.setJSData("", "", ""),
                        !0
                    } catch(a) {
                        return ! 1
                    }
                })
            },
            get: function(b) {
                var c, d = {};
                if (!a.IMPRESENCE || !a.IMPRESENCE.getJSData) return d;
                c = a.IMPRESENCE.getJSData(a.global.trailid, b || "");
                try {
                    c = a.JSON.parseJSON(c)
                } catch(e) {}
                if ("string" == typeof c) d = a.JSON.parseJSON(this.filter(c, !1) || "{}");
                else for (b in c) if (!a.isFunction(c[b])) try {
                    d[b] = a.JSON.parseJSON(this.filter(c[b], !1))
                } catch(f) {}
                return d
            },
            filter: function(a, c) {
                return ! 0 === c ? a.replace(/\"/gi, "{sy}") : a.replace(/\{sy\}/gi, '"')
            }
        }
    }), a.connectPresence = a.Class.create(), a.connectPresence.prototype = {
        name: "connectPresence",
        options: null,
        manage: null,
        debug: !1,
        data: null,
        switchTimeId: null,
        _connected: !1,
        currentConnectType: "",
        initialize: function(b, c, d) {
            var e;
            this.data = a.store;
            this.options = a.extend({
                nullparam: "",
                usemqtt: 0
            },
            b);
            switch (d) {
            case "mqtt":
                this.options.usemqtt = 1;
                e = "WebSocket" in window || "MozWebSocket" in window ? "websock": "1" == c ? "comet": "fssock";
                break;
            case "rtmp":
                "1" == c ? e = "comet": a.flash.support && (e = "rtmp")
            }
            switch (e) {
            case "websock":
                this.connect = this._createMqttConnect(this.options);
                break;
            case "fssock":
            case "rtmp":
                this.connect = this._createFlashConnect(this.options);
                break;
            default:
                this.options.usemqtt = 0,
                this.connect = this._createCometConnect(this.options)
            }
            a.Log("new $.connectPresence(); conType: " + e + ", isnoim:" + a.server.isnoim);
            this.manage = this.connect.manage ? this.connect.manage: new a.pageManage;
            this.manage.options.onChanage = function(b) {
                a.currentCount = b;
                a.Log("page manage callback: current open window number:" + a.currentCount, 1)
            };
            a.currentCount = this.manage.count;
            this.identid = this.manage.identid;
            this.connect.currentPage ? this.currentPage = this.connect.currentPage: (a.Log("new $.CurrentPage(" + this.identid + ")", 1), this.currentPage = new a.CurrentPage(this.identid, this.manage))
        },
        switchConnect: function() {
            this.stopSwitchConnect();
            this.currentConnectType != a.CON_CONNECT_COMET ? (a.Log("Flash abnormalities, switch the connection type. this.currentConnectType:" + this.currentConnectType + " > comet", 2), this.connect && a.isFunction(this.connect.remove) && a.flash.remove(this.connect), this.connect && a.isFunction(this.connect.disconnect) && this.connect.disconnect()) : a.Log("Flash abnormalities", 2)
        },
        stopSwitchConnect: function() {
            clearTimeout(this.switchTimeId);
            this.switchTimeId = null
        },
        setPageFocus: function(a, c, d) {
            a && this.currentPage.set(c, d)
        },
        closePresence: function() {
            if (this.connect) try {
                this.connect.closePresence()
            } catch(b) {}
            this.currentConnectType == a.CON_CONNECT_FLASH && a.flash.remove(this.connect);
            this.manage = this.connect = null
        },
        setJSData: function(a, c, d) {
            if (!a || "" === a) {
                var a = this.data.getAll(),
                e;
                for (e in a)"function" != typeof a[e] && -1 < e.indexOf("JDATA_") && this.data.remove(e)
            } else this.data.set("JDATA_" + a + "-" + c, d)
        },
        getJSData: function() {
            var b, c = {};
            b = this.data.getAll();
            for (var d in b)"function" != typeof b[d] && -1 < d.indexOf("JDATA_") && (c[d] = b[d]);
            return a.JSON.toJSONString(c)
        },
        _createFlashConnect: function(b) {
            a.Log("$.connectPresence._createFlashConnect()", 1);
            var c = a("#nTalk-flash-element"),
            b = a.flashHtml("ntkf_flash_impresence", a.sourceURI + "fs/impresence.swf?" + a.version.im, b);
            this.currentConnectType = a.CON_CONNECT_FLASH;
            c.length || (c = a(document.body).insert('<div id="nTalk-flash-element" class="nTalk-hidden-element" style="position: absolute; z-index: 9996; top: -200px;"></div>'));
            c.insert(b);
            a.browser.msie && c.find("#ntkf_flash_impresence").display(1);
            return c.find("#ntkf_flash_impresence").get(0)
        },
        _createCometConnect: function(b) {
            a.Log("$.connectPresence._createCometConnect()", 1);
            this.currentConnectType = a.CON_CONNECT_COMET;
            return new a.IMPresence(b)
        },
        _createMqttConnect: function(b) {
            a.Log("$.connectPresence._createMqttConnect()", 1);
            this.currentConnectType = a.CON_CONNECT_COMET;
            return new a.IMPresence(b)
        }
    },
    a.IMPresence = a.Class.create(), a.IMPresence.prototype = {
        name: "IMPresence",
        options: null,
        connectParams: "userid username token sessionid nullparam nullparam nullparam siteid nullparam nullparam connectType pcid nullparam".split(" "),
        connect: null,
        debug: !1,
        login: !1,
        currentPage: null,
        _reCount: 0,
        _waitTime: 500,
        _currentConnected: !1,
        _waitReconnectTimeID: null,
        _mqttFlag: !0,
        initialize: function(b) {
            var c = this;
            this._wsFlag = 1 == b.usemqtt ? !0 : !1;
            this.options = a.extend({
                nullparam: ""
            },
            a.whereGet(b, "siteid settingid cid surl u n s r ref fsid".split(" "), "siteid settingid pcid serverurl userid username sessionid resourceurl referrer flashsessionid".split(" ")));
            this.data = a.store;
            this._reCount = 0;
            if (!this.options.pcid || 10 >= this.options.pcid.length) if (this.options.pcid = this.data.get("machineid"), !this.options.pcid || 10 >= this.options.pcid.length) this.options.pcid = a.base._createScriptPCID();
            try {
                this.data.set("machineid", this.options.pcid)
            } catch(d) {
                a.Log(d, 3)
            }
            this.options.userid || (this.options.userid = a.base.userIdFix + this.options.pcid.substr(0, 21));
            this._callback("fIM_presenceFlashReady", [this.options.userid, this.options.pcid]);
            this.manage = new a.pageManage({
                onInterval: function(a, b) {
                    c._onInterval.call(c, a, b)
                },
                onChanage: function(a, b) {
                    c._onChanage.call(c, a, b)
                }
            });
            this.identid = this.manage.identid;
            this.currentPage = new a.CurrentPage(this.identid, this.manage);
            this.setPageFocus(!0, a.title, a.url)
        },
        loginConnect: function() {
            var b = this,
            c = "",
            d = this._toArray(this.options, this.connectParams);
            this.debug && a.Log("im.loginConnect()");
            this._callback("fIM_updateUserStatus", [1, ""]);
            if (a.server.presenceserver) {
                for (var e = a.server.presenceserver.split(";"), f = 0; f < e.length; f++) - 1 < e[f].indexOf("ws://") && (c = e[f]);
                c || (this._wsFlag = !1);
                this._wsFlag ? this.connect = new a.mqttws({
                    url: c,
                    siteid: b.options.siteid,
                    pcid: b.options.pcid,
                    onCallback: function() {
                        b._onCallback.apply(b, arguments)
                    },
                    loginMsg: a.JSON.toJSONString({
                        method: "roomConnect",
                        params: d
                    })
                }) : (this.connect = new a.comet(a.server.presencegoserver, {
                    timeout: 20,
                    onCallback: function() {
                        b._onCallback.apply(b, arguments)
                    },
                    onComplete: function(a) {
                        b._onComplete.apply(b, arguments)
                    },
                    onAbnormal: function(a) {
                        b._onAbnormal.apply(b, arguments)
                    },
                    onTimeout: function(a) {
                        b._onTimeout.apply(b, arguments)
                    }
                }), this.connect.connect({
                    action: "conn",
                    params: d.join(",")
                },
                "callback"))
            }
        },
        kaliveConnect: function() {
            this.debug && a.Log("$.IMPresence.kaliveConnect()", 1);
            var b = this;
            if (this._wsFlag) {
                var c = {
                    method: "remoteKeepAlive",
                    params: [null, this.options.userid, this.options.clientid]
                };
                this.connect.kalive(a.JSON.toJSONString(c))
            } else c = {
                action: "kalive",
                params: this._toArray(this.options, this.connectParams).join(","),
                clientid: this.options.clientid,
                machineid: this.options.pcid,
                token: this.options.token,
                uid: this.options.userid
            },
            setTimeout(function() {
                b.connect.kalive(c, "callback")
            },
            1E3)
        },
        reconnect: function() {
            var b = this;
            this._waitTime = 3 >= ++this._reCount ? 500 : 1E3 * +"034567890".charAt(Math.ceil(5 * Math.random()));
            this.debug && a.Log("$.IMPresence.reconnect() wait:" + this._waitTime, 1);
            this._waitReconnectTimeID = setTimeout(function() {
                b.connect.reconnect()
            },
            this._waitTime)
        },
        disconnect: function() {
            var a = this.data.getAll(),
            c;
            for (c in a)"function" != typeof a[c] && -1 < c.indexOf("JDATA_") && this.data.remove(c);
            clearTimeout(this._waitReconnectTimeID);
            this._waitReconnectTimeID = null
        },
        LoginResult: function(a, c, d, e) {
            this.login = a;
            this.options.clientid = d;
            this.options.token = e;
            this._callback("fIM_updateUserStatus", [this.login ? 2 : 0, ""]);
            this._callback("fIM_presenceSetIMSid", [this.login ? this.options.token: ""]);
            this.login ? this.kaliveConnect("call kalive") : this.reconnect("login relogin")
        },
        remoteNotifyChatWithGroup: function(b, c, d, e, f, h, g) {
            if (g) {
                b = a.clearHtml(g.substr(0, g.indexOf("ntalker://")));
                g = g.substr(g.indexOf("ntalker://") + 10);
                try {
                    a.JSON.parseJSON(g)
                } catch(i) {}
                a.store.isStorageSupported ? this._sendMessage2CurrenPage(b + "ntalker://" + g) : this._callback("fIM_onPresenceReceiveSysMessage", [1, b + "ntalker://" + g])
            } else this.debug && a.Log("message content is null", 3)
        },
        remoteNotifyUserCode: function() {
            a.Log("do remoteNotifyUserCode!!!")
        },
        remoteConfirmAddFriend: function() {
            a.Log("do remoteConfirmAddFriend")
        },
        _handleResponse: function(b, c) {
            this[b] ? this[b].apply(this, c) : a.Log("The object of the method '" + b + "' does not exist", 3)
        },
        _callback: function(b, c) {
            if (a.hasOwnProperty(b)) try {
                a[b].apply(this, c)
            } catch(d) {} else a.Log("nTalk." + b + "(...)", 2)
        },
        _onCallback: function(b, c) {
            var d;
            this.debug && a.Log("$.IMPresence.onCallback(  )");
            c.length && (d = c[0], /LoginResult|LoginReslut/gi.test(d) ? b && this.LoginResult.apply(this, c.slice(1)) : (this._handleResponse.call(this, d, c.slice(1)), b && this.kaliveConnect("call kalive")))
        },
        _onComplete: function() {
            var b = Array.prototype.slice.call(arguments);
            this.debug && a.Log("$.IMPresence.onComplete( " + b[0] + "," + b[1] + "," + b[2] + " )");
            "kalive" == b[0] ? this.kaliveConnect("complete kalive") : "login" == b[0] && this.reconnect("abnormal login")
        },
        _onAbnormal: function() {
            var b = Array.prototype.slice.call(arguments);
            this.debug && a.Log("$.IMPresence.onAbnormal( " + b[0] + "," + b[1] + "," + b[2] + " )", 3);
            "login" == b[0] ? this.reconnect("abnormal login") : this.kaliveConnect("abnormal kalive")
        },
        _onTimeout: function() {
            var b = Array.prototype.slice.call(arguments);
            this.debug && a.Log("$.IMPresence.onTimeout( " + b[0] + "," + b[1] + "," + b[2] + " )", 3);
            "login" == b[0] ? this.reconnect("time login") : this.kaliveConnect("timeout kalive")
        },
        _onInterval: function(b, c) {
            this.currentConn = this.data.get("IM_CUREENT_CONNECT") || {
                identid: "",
                time: 0
            };
            if (this.currentConn.identid && this.currentConn.identid === this.identid) this.currentConn.time = a.getTime(),
            this.data.set("IM_CUREENT_CONNECT", this.currentConn),
            this._fireEvent("update");
            else {
                var d;
                if (a.isArray(c)) for (var e = 0; e < c.length; e++) if ((page = c[e]) && page[this.currentConn.identid]) this._currentConnected = d = !0;
                this.currentConn.identid && (this.currentConn.identid !== this.identid && !d) && (this.currentConn.identid = "", this._currentConnected = !1, this._fireEvent("clear"));
                this.debug && a.Log("currentConnect>>_onInterval:" + a.JSON.toJSONString(this.currentConn) + ", _currentConnected:" + this._currentConnected);
                if ((!this.currentConn.identid || "" == this.currentConn.identid) && !this._currentConnected) {
                    this.currentConn = {
                        identid: this.identid,
                        time: a.getTime()
                    };
                    this._currentConnected = !0;
                    try {
                        this.data.set("IM_CUREENT_CONNECT", this.currentConn)
                    } catch(f) {
                        a.Log(f, 3)
                    }
                    this._fireEvent("add");
                    this.loginConnect()
                } else this._fireEvent("wait")
            }
        },
        _onChanage: function(a) {
            this.pageCount = a
        },
        _fireEvent: function(b) {
            1 == this.temp || !this.temp ? (this.temp = 1, this.debug && "wait" !== b && a.Log(this.identid + ", " + b + " long connect, curPage:" + this.currentPage.get(), 2)) : 5 <= this.temp && (this.temp = 0);
            this.temp++;
            this._currentGetMessage()
        },
        _toArray: function(a, c) {
            var d = [];
            if (!a) return "error";
            for (var e = 0; e < c.length; e++) d.push(a[c[e]] || "");
            return d
        },
        _sendMessage2CurrenPage: function(b) {
            var c = this.data.get("IM_SEND_CURRENT_PAGE_DATA");
            b && (this.Queue || (this.Queue = new a.Queue), c ? this.Queue.enQueue({
                data: b
            }) : this.data.set("IM_SEND_CURRENT_PAGE_DATA", b))
        },
        _currentGetMessage: function() {
            var b = this.data.get("IM_SEND_CURRENT_PAGE_DATA");
            if (b) {
                try {
                    b = a.JSON.parseJSON(b)
                } catch(c) {}
                this.currentPage.get() && b && (this.data.remove("IM_SEND_CURRENT_PAGE_DATA"), this._callback("fIM_onPresenceReceiveSysMessage", [1, b]), this.Queue && (b = this.Queue.deQueue()) && this._sendMessage2CurrenPage(b.data))
            }
        },
        setPageFocus: function(a, c, d) { ! 0 === a && this.currentPage.set(c, d)
        },
        closePresence: function() {
            if (this._wsFlag) this.connect.disconnect();
            else try {
                this.cometd.disconnect(!0)
            } catch(a) {}
            this.data.remove("IM_CUREENT_CONNECT")
        },
        setJSData: function(a, c, d) {
            if (!a || "" === a) {
                var a = this.data.getAll(),
                e;
                for (e in a)"function" != typeof a[e] && -1 < e.indexOf("JDATA_") && this.data.remove(e)
            } else this.data.set("JDATA_" + a + "-" + c, d)
        },
        getJSData: function() {
            var b, c = {};
            if ((b = Array.prototype.slice.call(arguments, 0, 2).slice(0, 2).join("-")) && arguments[1]) return a.JSON.toJSONString(this.data.get(b));
            b = this.data.getAll();
            for (var d in b)"function" != typeof b[d] && -1 < d.indexOf("JDATA_") && (c[d] = b[d]);
            return a.JSON.toJSONString(c)
        }
    },
    a.CurrentPage = a.Class.create(), a.CurrentPage.prototype = {
        name: "CurrentPage",
        cachePageData: null,
        identid: "",
        debug: !1,
        manage: null,
        initialize: function(b, c) {
            b ? (this.identid = b, this.manage = c, this.data = a.store) : a.Log("$.CurrentPage params failed", 3)
        },
        set: function(b, c) {
            if (!b || !c) return a.Log("title is null, url is null"),
            !1;
            this.cachePageData = {
                identid: this.identid,
                title: b,
                url: c
            };
            this.debug && a.Log("$.CurrentPage.set():" + a.JSON.toJSONString(this.cachePageData), 1);
            this.data.set("IM_CURRENT_PAGE", this.cachePageData)
        },
        get: function() {
            var b, c = !1;
            this.cachePageData = this.data.get("IM_CURRENT_PAGE");
            if (!this.cachePageData || a.isEmptyObject(this.cachePageData)) return ! 1;
            var d = a._getExistPageList();
            if (0 < d.length) {
                for (var e = 0; e < d.length; e++) if (b = d[e], b == this.cachePageData.identid) {
                    c = !0;
                    break
                }
                if (!1 === c && this.identid == d[d.length - 1]) return this.set(a.title, a.url),
                !0
            }
            this.debug && (a.Log("::" + a.JSON.toJSONString(this.cachePageData)), a.Log("cache page identid:" + this.cachePageData.identid + ", identid:" + this.identid + ", currentPage: " + (this.cachePageData.identid == this.identid)));
            try {
                return this.cachePageData.identid == this.identid ? !0 : !1
            } catch(f) {
                return ! 1
            }
        }
    })
})(nTalk);